参考答案:include <stdio.h>int main(){ int i,j,f,sum = 0; for(i=100;i<=200;i++) { f = 1; for(j=2;j<=i/2;j++) { if(i%j == 0) { f = 0; break; } } if(f) { printf("%d\t",i); ...
int i,j,isPrime,PrimeSum = 0;float p;/*从101开始循环,只需要检测奇数,所以每次加2*/ for (i=101;i<200;i+=2){ p = sqrt(i);/*标识变量,1表示是素数*/ isPrime = 1;/*只需要循环到n的平方根*/ for (j=2;j<=p;j++){ /*能整除,则不是素数,循环加1*/ if (i%j =...
j,k,l; FILE *fp; if((fp=fopen("b.txt","w"))==NULL){ printf("Open the file failure...\n"); exit(0); } for(i=101;i<200;i+=2){