1.循环遍历1~N;
2.满足条件num%2==1,num%3==2,num%5==4,num%6==5,num%7==0;
3.输出所有满足数;
#include<iostream>
using namespace std;
int main(){
int N;
printf("请输入一个数:");
cin>>N;
for(int num=1;num<=N;num++){
if(num%2==1&&num%3==2&&num%5==4&&num%6==5&&num%7==0){
printf("%3d满足以上条件\n",num);
}
}
return 0;
}
标签:爱因斯坦,17,int,num%,num,&&,printf,day From: https://www.cnblogs.com/drz1145141919810/p/17357246.html