哪错了??也是求素数的!!
public class aaa{
public static void main(String args[])
{ int m,i,k,h=0;
System.out.println("最小的50个素数为:");
while(h<=50)
{
for(m=0;m<=100;m++)
{ k=(int)(Math.sqrt(m+1));
for(i=2;i<=k;i++)
{ if(m%i==0) continue;
//*输出
else if(m<10) System.out.print(" "+m);
else System.out.print(" "+m);
h++;
if(h%10==0) System.out.print("\n");}
}
}
}
}
哪错了??怎么输出有重复??还不能控制在50个之内