一个求1-100之间的素数程序,错在哪里?我找了好久找不出来
#include "stdio.h"#include "math.h"
main()
{int i=1,m,n;
printf("the prime is 2 ");
for (m=3;m<=100;m++,m++)
{ n=sqrt(m);
for(i=2;i<=n;i++)
if (m%i==0) break;
if (i>n)
printf("%d ",m);
}
}
8 D:\JMSOFT\413hd.c stray '\161' in program
8 D:\JMSOFT\413hd.c stray '\161' in program
.....
显示出错如上
[此贴子已经被作者于2007-11-8 17:51:11编辑过]