import java.util.Random;public class Test {
public static void main(String[] args) {
int current,next;
Random rand = new Random();
current = rand.nextInt(10000);
System.out.print(current);
for(int i = 0 ; i < 25 ; i ++)
{
next = rand.nextInt(10000);
if(current < next)
{
System.out.print(" < ");
}
else if(current == next)
{
System.out.print(" = ");
}
else
{
System.out.print(" > ");
}
System.out.println(next);
current = next;
}
}
}
public static void main(String[] args) {
int current,next;
Random rand = new Random();
current = rand.nextInt(10000);
System.out.print(current);
for(int i = 0 ; i < 25 ; i ++)
{
next = rand.nextInt(10000);
if(current < next)
{
System.out.print(" < ");
}
else if(current == next)
{
System.out.print(" = ");
}
else
{
System.out.print(" > ");
}
System.out.println(next);
current = next;
}
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货