【发布时间】:2015-05-09 07:58:56
【问题描述】:
package Lessons;
import java.util.Scanner;
public class Math {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.print("please enter the first number of your question! ");
int a1 = s.nextInt();
System.out.print("So you chose " + a1);
System.out.println(" Choose ur second number");
int a2 = s.nextInt();
System.out.print("You chose " + a2 + " for your second number");
System.out.print(" Now enter ur operator ");
String b1 = s.nextLine();
if (b1.equalsIgnoreCase("-")) {
System.out.println("You chose " + b1 + "as ur operator");
}
}
}
我不明白为什么第 15 行不接受任何输入,任何帮助将不胜感激:3
输出
请输入您的问题的第一个数字! 2552 所以你选择了2552 选择你的第二个号码 41 你选择了 41 作为你的第二个号码 现在 输入你的运营商
由于某种原因,输出在最后一行结束并停止,不带任何信息!
【问题讨论】:
-
你能发布你的输出吗?
标签: java