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