1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
| #include<iostream> #include<map> #include<string> using namespace std;
map<string,int> mp; string sp[]={"1s","2s","3s","4s","5s","6s","7s","8s","9s"}; string pp[]={"1p","2p","3p","4p","5p","6p","7p","8p","9p"}; string wp[]={"1w","2w","3w","4w","5w","6w","7w","8w","9w"}; string zi[]={"dong","nan","xi","bei","bai","fa","zhong"}; int main(){ bool jiulian=false,shisan=false; bool jiulians=true,jiulianp=true,jiulianw=true; bool guoshi=true; for(int i=0;i<14;i++){ string s; cin>>s; mp[s]++; }
for(int i=1;i<8;i++){ if(mp[sp[i]]<1) { jiulians=false; } if(mp[pp[i]]<1) { jiulianp=false; } if(mp[wp[i]]<1) { jiulianw=false; } } if(jiulians){ if(mp[sp[0]]>=3&&mp[sp[8]]>=3) cout<<"jiulianbaodeng!"<<endl; jiulian=true; } else if(jiulianp){ if(mp[pp[0]]>=3&&mp[pp[8]]>=3) cout<<"jiulianbaodeng!"<<endl; jiulian=true; } else if(jiulianw){ if(mp[wp[0]]>=3&&mp[wp[8]]>=3) cout<<"jiulianbaodeng!"<<endl; jiulian=true; }
else if(mp[sp[0]]>=1&&mp[pp[0]]>=1&&mp[wp[0]]>=1&&mp[sp[8]]>=1&&mp[pp[8]]>=1&&mp[wp[8]]>=1){ for(int i=0;i<7;i++){ if(mp[zi[i]]<1){ guoshi=false; break; } } if(guoshi) { cout<<"shisanyao!"<<endl; shisan=true; } } if(!jiulian&&!shisan) cout<<"I dont know!"<<endl; }
|