import java.util.Scanner;
public class ADD {
public static void main(String[] args) {
// TODO code application logic here
int num1=(int)(Math.random()*100);
int num2=(int)(Math.random()*100);
System.out.print("What is"+num1+"+"+num2+"?\n");
Scanner input=new Scanner(System.in);
int answer=input.nextInt();
if (num1+num2==answer)
System.out.println("You are correct!");
else
System.out.println("Your answer is wrong\n"+num1+"+"+num2+"should be"+(num1+num2));
}
}
随机产生一个计算两个小于100的整数的加法问题
最新推荐文章于 2022-12-24 22:42:29 发布