问题补充:
public static void main(String[] args) {
int num=0;
// TODO Auto-generated method stub
Scanner reader=new Scanner(System.in);
String str=reader.nextLine();
String[] strNum=str.split("\\+");
for (int i = 0; i < strNum.length; i++) {
System.out.println(strNum[i]);
num+=(Integer.parseInt(strNum[i]));
}
String[] strNum2=str.split("\\-");
for (int i = 0; i < strNum2.length; i++) {
System.out.println(strNum2[i]);
num-=Integer.parseInt(strNum2[i]);
}
String[] strNum3=str.split("\\*");
for (int i = 0; i < strNum3.length; i++) {
System.out.println(strNum3[i]);
num*=Integer.parseInt(strNum3[i]);
}
String[] strNum4=str.split("\\/");
for (int i = 0; i < strNum4.length; i++) {
System.out.println(strNum4[i]);
num/=Integer.parseInt(strNum4[i]);
}
System.out.println(num);
}