我想做一个简单的计算器,但我不知道如何像真正的计算器一样输入许多操作。
switch (choice)
{
case 1:
System.out.println("Please enter 2 numbers only: " );
x = input.nextInt();
y = input.nextInt();
sum = calc.add(x,y);
System.out.printf("The sum is %d\n\n",sum);
out.write(x + "+" + y + "=" + sum);
break;
case 2:
...
case 3:
...
}