晕 六楼有错误,应该这样改为:#include <math.h>#include <stdio.h>#include <conio.h>main(){ int i,j; for (i=1;i<=100;i++) { for (j=2;j<=(int)sqrt(i);j++) if (i%j==0) break; if (i%j!=0) printf("%2d is prime\t",i); }
getch(); return 0;}