用Java实现四则运算

public class math {
public static void main(String[] args) {

String[] operate=new String[]{"+","-","×","÷"};
int[] numbers=new int[300];

for(int i=1;i<=300;i++){
numbers[i-1]=i;
}
Random r=new Random();

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

System.out.println(numbers[r.nextInt(300)]+operate[r.nextInt(4)]+numbers[r.nextInt(300)]+"=");
}
}
}
posted @ 2017-03-12 19:41  陌上花开222  阅读(315)  评论(0编辑  收藏  举报