题目:求100之内的素数
public class Sushu {
public static void main(String[] args) {
boolean flag = false;
int count = 0;
for(int j=1;j<=100;j++){
for(int i=2;i<j;i++){
if(j%i==0){
flag = false;
break;
}else{
flag = true;
}
}
if(flag == true){
System.out.print(j+" ");
count++;
}
}
System.out.println("\n" + "Total "+ count + " prime number between 1 and 100");
}
}