C语言编程编写程序,用穷举法输出100以内素数的和(请写出代码编
编写,用穷举法输出100以内素数的和(请写出代码编程过程)
#include #include void main() { int i,j,t,s=2; for(i=3;i<100;i++) { t=1; for(j=2;j<=sqrt(i);j++) if(i%j==0) { t=0; break; } if(t==1)s=s+i; } printf("%d\n",s); }