所需日期:如何在Java的前一行打印?
第一個座標是(input1,input2)。
我會得到什麼:
第一個座標爲(輸入1
,輸入2
)。
我使用的代碼:
Scanner Narwhal = new Scanner(System.in);
System.out.print("The first coordinate value is (");
double x = Narwhal.nextDouble();
System.out.print(", ");
double y = Narwhal.nextDouble();
System.out.print(").");
謝謝!
您正在混合輸入和輸出,並且您使用驗證了輸入...或者? –
您的輸入與您的輸出混合在一起。如果你不想讓它們混合,那麼做一個另一個, –