/*
编写for循环找出1~100中所有的素数
素数
8个换行
*/
public class ForTest09
{
public static void main(String[] args)
{
int count = 0;
for (int x=2 ; x<=100 ; x++ )
{
boolean isPrime = true;
for(int y=2; y<x ; y++){
if(x%y0){
isPrime = false;
break;
}
}
if(isPrime){
System.out.print(x+" ");
count++;
//也可以求余 count%80
if(count==8){
System.out.print("\n");
count=0;
}
}
}
}
}