JAVA101-200素数

package work01;

public class Example14 {
public static void main(String[] args) {
int x= 101,counter = 0;
while (x<200) {
int i=2;
while(i<x) {
if (x%i == 0) break;
i++;
}
if (i == x) {
counter++;
System.out.println(x+"");
}
x++;
}
System.out.println("一共有"+counter+"个素数");

}

}

WRITTEN BY: