讲解对象:同时被3 5 7整除的就输出
作者:融水公子 rsgz
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main(){
int n;
for(n=1;n<=1000;n++){
if(n%3!=0){continue;}
if(n%5!=0){continue;}
if(n%7!=0){continue;}
printf("%d ",n);//105 210 315 420 525 630 735 840 945
}
printf("\n");
system("pause");
return 0;
}
联系客服