求第一个大于1000的素数..请指教..
我写的如下:#include <math.h>
main()
{
int a,b,n,m;
for(n=1000;;n++)
{
m=sqrt(n);
for(a=2;a<=m;a++)
{if(n%a==0) break;
if(a>m) printf("this is the first num:%d",n);getch();}
break;}
}
但是编译出来不对...请指教..
2005-10-31 13:46
2005-10-31 14:05