1 #include <stdio.h> 2 int main() 3 { 4 int i,j,count=0,s=0;
5 for(i=300;i<=500;i++) 6 { 7 for(j=2;j<=i-1;j++) 8 if(i%j==0)break; 9 if(j>=i) 10 { 11 printf("%-4d,",i); 12 count++; 13 s=s+i; 14 if(count%8==0)printf("\n"); 15 } 16 } 17 printf("\n 个数=:%d ,和 s=%d\n",count,s); 18 }
标签:count,300,个数,素数,写出,printf From: https://www.cnblogs.com/DF696/p/16960441.html