提交时间:2023-06-23 15:12:40
运行 ID: 21138
#include<bits/stdc++.h> using namespace std; int main(){ int a,n; cin>>a; if(a%3==0) n=1; if(a%5==0) n=2; if(a%7==0) n=3; if((a%3==0)&&(a%5==0)) n=4; if((a%3==0)&&(a%7==0)) n=5; if((a%5==0)&&(a%7==0)) n=6; if((a%3==0)&&(a%5==0)&&(a%7==0)) n=7; switch(n) { case 1: cout<<"3"<<endl; break; case 2: cout<<"5"<<endl; break; case 3: cout<<"7"<<endl; break; case 4: cout<<"3 5"<<endl; break; case 5: cout<<"3 7"<<endl; break; case 6: cout<<"5 7"<<endl; break; case 7: cout<<"3 5 7"<<endl; break; default: cout<<n<<endl; } return 0; }