四则运算01
原程序代码:
//package wenjian;
import java.util.Random;
public class operation1 {
public static void main(String []args)
{
for(int i=0;i<60;i++)
{
String q=null;
Random random=new Random();
int x=random.nextInt(100)+1;
int y=random.nextInt(100)+1;
int z=random.nextInt(4);
switch(z)
{
case 1:
q="+";break;
case 2:
q="-";break;
case 3:
q="*";break;
case 0:
q="/";break;
}
System.out.println(x+q+y+"=");
}
}
}
实验截图: