打印 1

public static void main(String[] args) {
int count = 0;
for (int i = 2; i < 101; i++) {
for (int j = 2; j <= i; j++) {
if (i % j == 0 && i != j)
break;
if (j == i) {
if (count % 5 == 0)
System.out.println();
System.out.print(j + " ");
count++;
}
}
}
System.out.println(" 素数有" + count + "个");
}

原文地址:https://www.cnblogs.com/LinYanyan1024-6285/p/14242575.html