|20挑战3|3v

    科技2024-11-16  5

    //10 //11 12 13 24 25 26 37 38 39 40 //11 24 37 //12 25 38 //13 26 39 #include <iostream> #include <cstdio> #include <vector> using namespace std; vector<int> a; vector<int> b; vector<int> c; int main() { int n; cin>>n; ///getchar(); for(int i=0;i<n;i++){ int tmp; cin>>tmp; if(tmp%10==1||tmp%10==4||tmp%10==7){ a.push_back(tmp); }else if(tmp%10==2||tmp%10==5||tmp%10==8){ b.push_back(tmp); }else if(tmp%10==3||tmp%10==6||tmp%10==9){ c.push_back(tmp); } } for(int i=0;i<a.size();i++){ if(i==0)cout<<a[i]; else cout<<" "<<a[i]; } cout<<endl; for(int i=0;i<b.size();i++){ if(i==0)cout<<b[i]; else cout<<" "<<b[i]; } cout<<endl; for(int i=0;i<c.size();i++){ if(i==0)cout<<c[i]; else cout<<" "<<c[i]; } cout<<endl; return 0; }
    Processed: 0.042, SQL: 8