import java.util.Scanner;
public class CalculatorDemo {
public static void main(String[]args){
Scanner input=new Scanner(System.in);
int number1=10+(int)(Math.random()*90);
int number2=10+(int)(Math.random()*90);
int operator=(int)(Math.random()*2);
int result;
int answer=0;
if(operator==0){
result=number1+number2;
System.out.print(number1+"+"+number2+"=");
}else{
if(number1<number2){
int temp=number2;
number2=number1;
number1=temp;
}
result=number1-number2;
System.out.print(number1+"-"+number2+"=");
}
answer=input.nextInt();
System.out.println("请输入你的结果:"+answer);
if(result==answer){
System.out.println("恭喜你答对了!");
}else{
System.out.println("对不起,回答错误!");
}
}
}