static int num = 0;
public static void main(String[] args) {
int b = 0;
ourt: for (int i = 2; i < 100; i++) {
for (int j = 2; j < i; j++) {
if (i % j == 0) {
b++;
continue ourt;
}
}
if (b == 0) {
num++;
System.out.print(" " + i);
}
}
System.out.println(" " + num);
}
输出 2 3 2