package javaTest;
public class Prime {
public static void main(String[] args) {
for(int n =1; n<=100; n++){
if(isPrime(n)){
System.out.println(n+"是素数");
continue;
}
}
}
public static boolean isPrime(int n){
boolean flag = true;
if(n<掘核2)
flag=false;
else
for(int i=2;i<=Math.sqrt(n);i++){
if(n%i==0)
flag = false;
}
return flag;
}
}