本帖最后由 qihaichengtian 于 2016-9-24 02:06 编辑
public class Qiseqiu {
public static void main(String[] args) {
Random r = new Random();
ArrayList<int> list = new ArrayList<>();
list.add(r.nextInt(10) + 1);
loop: while (list.size() <7) {
int random = r.nextInt(33) + 1;
for (int i = 0; i < list.size(); i++) {
if (random=list.get(i) ) {
continue;
}else{
list.add(r);
}
}
for ( i = 0; i < list.size(); i++) {
System.out.print("list.get(i)");
}
System.out.println();
}
}
|
|