/*
* Test54-编程打印所有的3位质数,质数特点:只能被1和其本身整除
*/
public class Demo {
public static void main(String[] args) {
for (int x = 100; x < 1000; x++) {
int count = 0;
for (int y = 1; y < x; y++) {
if (x % y == 0) {
count++;
}
}
if (count < 2) {
System.out.println(x);
}
}
}
}
* Test54-编程打印所有的3位质数,质数特点:只能被1和其本身整除
*/
public class Demo {
public static void main(String[] args) {
for (int x = 100; x < 1000; x++) {
int count = 0;
for (int y = 1; y < x; y++) {
if (x % y == 0) {
count++;
}
}
if (count < 2) {
System.out.println(x);
}
}
}
}