100以内的两位数加法随机题

    技术2026-06-16  8

    利用while循环出100以内的加减法题目,并计算你的分数,考一考你的口算能力

    `import java.util.Random; import java.util.Scanner;

    /** *

    @author taoyang@version 1.0@Date 2020年7月4日 上午10:13:10@Description:

    */ public class ReadomDemo { public static void main(String[] args) { Random rd=new Random(); Scanner sc=new Scanner(System.in); int couter=1; int score=0; while(couter<=10) { int num1=rd.nextInt(100); int num2=rd.nextInt(100); System.out.printf(“第%d题:%n”,couter); System.out.printf("%d+%d=?%n",num1,num2); int t=sc.nextInt(); if(t==num1+num2) { System.out.println(“✓”); score +=10; }else { System.out.println(“×”); } couter++; } System.out.println(“最后得分:”+score);

    }

    }

    `

    Processed: 0.008, SQL: 9