300题

public class a300 {   

public static void show(Object j){   

System.out.println(j);   

}  

public static void main(String[] args){

  for(int i=0;i<300;i++){   

int a = (int)(Math.random()*100)+1;//随机数1到100   

int b = (int)(Math.random()*100)+1;   

int c = (int)(Math.random()*4)+1;//随机数1到4  

 if(c==1)    show(a + "+" + b + "=");   

else if(c==2)    show(a + "-" + b + "=");   

else if(c==3)    show(a + "*" + b + "=");   

else if(c==4)    show(a + "/" + b + "=");  

 }   

show("一共有:300到题");   }   }

posted on 2017-03-12 19:39  王jiangbei  阅读(79)  评论(0编辑  收藏  举报