1 package yunsuan; 2 3 import java.util.Random; 4 5 public class math { 6 public static void main(String[] args) { 7 String[] operate = new String[] { "+", "-", "*", "/" }; 8 int[] numbers = new int[1000]; 9 for (int i = 1; i <= 1000; i++) { 10 numbers[i - 1] = i; 11 } 12 Random r = new Random(); 13 for (int i = 0; i < 300; i++) { 14 System.out.println(numbers[r.nextInt(1000)] + 15 operate[r.nextInt(4)] + 16 numbers[r.nextInt(1000)] + "="); 17 } 18 } 19 20 }