1 package random;
2 import java.util.*;
3 import java.math.*;
4 public class Com {
5
6 public static void main(String[] args) {
7 // TODO 自动生成的方法存根
8 int flag=(int)(Math.random()*100);
9 ComDem name1=new ComDem();
10 /*
11 * resu1 +
12 * resu2 -
13 * resu3 *
14 * resu4 /
15 */
16 Random choice=new Random(1);
17 int choices;
18 /*
19 * 格式化输出 5列6行
20 * 定义 line row
21 */
22 int line=0;
23 Random rand1 =new Random(8);
24 Random rand2 =new Random(10);
25 name1.num1=rand1.nextInt(101);
26 name1.num2=rand2.nextInt(101);
27 int resu1,resu2,resu3;
28 double resu4;
29 for(int i=0;i<30;i++)
30 {
31 /*
32 * 查重
33 */
34 while(name1.num1==name1.num2)
35 {
36 name1.num1=rand1.nextInt(101);
37 name1.num2=rand2.nextInt(101);
38 }
39 choices=choice.nextInt(4);
40
41 switch(choices) {
42 case 0:
43 System.out.print("("+(i+1)+")");
44 resu1=name1.add();
45 break;
46 case 1:
47 System.out.print("("+(i+1)+")");
48 resu2=name1.sub();
49 break;
50 case 2:
51 System.out.print("("+(i+1)+")");
52 resu3=name1.mix();
53 break;
54 case 3:
55 System.out.print("("+(i+1)+")");
56 resu4=name1.chu();
57
58 break;
59 }
60 line++;
61 if(line!=0&&line%5==0)
62 {
63 System.out.println();
64 }
65 name1.num1=rand1.nextInt(101);
66 name1.num2=rand2.nextInt(101);
67 }
68 }
69