public class ExamTest {
public static void main(String[] args) {
ArrayList<Integer> al = new ArrayList<>();
boolean flag = true;
for (int a = 100; a < 1000; a++) {
flag = true;
for (int b = 2; b < a; b++) {
if (a % b == 0) {
flag = false;
break;
}
}
if (flag) {
al.add(a);
}
}
Collections.reverse(al);
System.out.print(al);
}
}作者: 13798223575 时间: 2015-8-13 00:40
不错,好好学习学习了。。作者: wh121 时间: 2015-8-14 00:38
不错,学习了