啊?这是一个算法题。。
经过5秒钟的沉思
我打开了我的eclipse
String[] test={"70","million","来自","百度知道"};
Boolean[] abc={false,false,false,false};
int temp;
Random random=new Random();
int i=0;
while (i < 3) {
temp=random.nextInt(4);
if (!abc[temp]) {
System.out.println(test[temp]);
abc[temp]=true;
i++;
}
}
写下了一堆莫名的东西,啊?
一运行,
居然和楼主的问题的答案一样。