test4.2

来源:互联网 发布:swift权威编程指南 编辑:程序博客网 时间:2024/05/29 17:21
/*target:produce 25 random value,and compare them;
 * methods:use Random and if/else
 */
import java.util.*;
public class Test2 {
public static void main(String[] args) {
Random rand=new Random(50);
for(int i=0;i<25;i++)
{
int m=rand.nextInt(50);int n=rand.nextInt(50);
if(m>n)
System.out.println("Bigger");
else if(m<n)
System.out.println("Smaller");
else
System.out.println("Equal");
}
}
}
0 0
原创粉丝点击