0
這是我到目前爲止有:如何更改用戶輸入(Java)的位置?
import java.util.Scanner;
public class CurrencyConverter
{
public static void main(String [ ] args)
{
Scanner pesos = new Scanner(System.in);
System.out.println("What is the current exchange rate for pesos to dollars?");
System.out.println();
Scanner yen = new Scanner(System.in);
System.out.println("What is the current exchange rate for yen to dollars?");
System.out.println();
Scanner euros = new Scanner(System.in);
System.out.println("What is the current exchange rate for euros to dollars?");
}
}
什麼我添加到改變從
到
感謝。
使用一臺'Scanner'並使用'Scanner#nextLine'在用戶需要時讀取響應 – MadProgrammer