Automatic primary topic applet is not difficult, generate random numbers using a random number, a predetermined range and determines the appropriate output to avoid repetition subject, the array of numbers may be used for each output are stored in the array, the generated random next the number of elements in the array and digital comparison can, if repeated a random number is generated again, otherwise output and stored again.
code show as below:
. 1 Package the Test; 2 . 3 Import Classes in java.util *. ; . 4 . 5 public class TestPlus { . 6 static Scanner in = new new Scanner (the System.in); . 7 public TestPlus () { . 8 // the TODO Auto-Generated Stub constructor . 9 } 10 static int the getNumber () // Get the divisor and the dividend . 11 { 12 is return ( int ) (Math.random () * + 100. 1 ); 13 is } 14 static intgetKey () // random number of 0 to 3 to represent four operators 15 { 16 return ( int ) (Math.random () * 10. 4% ); . 17 } 18 is static void Output ( int COUNT, int num1, int Key, int num2) // output method . 19 { 20 is char CH = 0 ; 21 is Switch (Key) 22 is { 23 is Case 0: CH = '+'; BREAK ; 24 Case . 1: CH = '-'; BREAK ; 25 Case2: CH = '*'; BREAK ; 26 is Case . 3: CH = '/'; BREAK ; 27 default : BREAK ; 28 } 29 of System.out.print (COUNT + "," CH + + + num1 num2 + "=" ) ; 30 } 31 is static Boolean handle ( int num1, int Key, int num2) // number generated is determined to meet the requirements 32 { 33 is Boolean B = to true ; 34 is Switch (Key) 35 { 36 Case 0:break; 37 case 1: 38 { 39 if(num1<num2) 40 b=false; 41 }break; 42 case 2: 43 { 44 if(num1*num2>=100) 45 b=false; 46 }break; 47 case 3: 48 { 49 if(num1%num2!=0) 50 B = to false ; 51 is } BREAK ; 52 is default : BREAK ; 53 is } 54 is return B; 55 } 56 is public static void main (String [] args) { 57 is // the TODO Auto-Generated Method Stub 58 int A [] [] = new new int [100000] [. 3 ]; // create an array of numbers stored already output 59 int num1, Key, num2, COUNT =. 1 ; 60 Boolean in Flag = to true ; 61 is int R & lt, SUM; 62 is SUM = in.nextInt (); 63 is R & lt = in.nextInt (); 64 do 65 { 66 Boolean tempFlag = to true ; 67 num1 = the getNumber (); 68 Key = getKey (); 69 num2 = the getNumber (); 70 iF (COUNT> = 2 ) 71 is for ( int I = 0; I <COUNT-. 1; I ++ ) // if the number is determined newly generated and previously subject repeated 72 iF (a [I] [ 0] == num1 && a [i ] [1] == key && a [i] [2] ==num2) 73 { 74 tempFlag=false; 75 break; 76 } 77 if(handle(num1,key,num2)&&tempFlag) 78 { 79 output(count,num1,key,num2); 80 a[count-1][0]=num1;a[count-1][1]=key;a[count-1][2]=num2; 81 if(count%r==0) 82 System.out.println(); 83 if(count>=sum) 84 flag=false; 85 count++; 86 } 87 }while(flag); 88 } 89 90 }