提交时间:2024-01-27 16:13:10

运行 ID: 38522

#include<iostream> using namespace std; int main() { int a; cin>>a; bool b1,b2,b3; b1=a%3==0; b2=a%5==0; b3=a%7==0; if((b1==1)&&(b2==1)&&(b3==1)){ cout<<"3 5 7"; } else if((b1==0)&&(b2==1)&&(b3==1)){ cout<<"5 7"; } else if((b1==1)&&(b2==0)&&(b3==1)){ cout<<"3 7"; } else if((b1==1)&&(b2==1)&&(b3==0)){ cout<<"3 5"; } else if((b1==1)&&(b2==0)&&(b3==0)){ cout<<"3"; } else if((b1==0)&&(b2==1)&&(b3==0)){ cout<<"5"; } else if((b1==0)&&(b2==0)&&(b3==1)){ cout<<"7"; } else if((b1==0)&&(b2==0)&&(b3==0)){ cout<<"n"; } }