#include<stdio.h> int main() { int sum=0,i,j; for(i=200;i<=299;i++){ for(j=2;j<=i/2;j++) if(i%j==0) break; if(j>i/2){ sum=sum+1; if(sum!=8) printf("%d ",i); else{ printf("%d\n",i); sum=0; } } } return 0; }
#include<stdio.h> int main() { int sum=0,i,j; for(i=200;i<=299;i++){ for(j=2;j<=i/2;j++) if(i%j==0) break; if(j>i/2){ sum=sum+1; if(sum!=8) printf("%d ",i); else{ printf("%d\n",i); sum=0; } } } return 0; }
转载于:https://www.cnblogs.com/Estwind/p/10100007.html