public class $ {
public static void main(String[] args) {
for (int i = 2; i <= 100; i++) {
if (isZhishu(i)) {
System.out.println(i);
}
}
}
private static boolean isZhishu(long num) {
long sqrt = (long) Math.sqrt(num) + 1;
for (int i = 2; i < sqrt; i++) {
if (num % i == 0) {
return false;
}
}
return true;
}
}
for(int i=1;i<=100;i++){
int k=(int) Math.sqrt(i);
for(int j=2;j<=k;j++){
if(i%j==0){
break;
}
}
if(j>k){
System.out.println(i);
}
懒得写!!!!