|
|
вернуться в форумWA2, where is the mistake? #include <string> #include <iostream> #include <map> using namespace std; int main() { int n; scanf("%d\n",&n); map<char,int> peng; peng['E']=0; peng['M']=0; peng['L']=0;
string tmp="";
for(int i=0;i<n;i++) { getline(cin,tmp); if(tmp[0]=='E' || tmp[0]=='M' || tmp[0]=='L') peng[tmp[0]]++; } map<char,int>::reverse_iterator rit = peng.rbegin(); switch(rit->first) { case 'E': cout<<"Emperor Penguin"<<endl;break; case 'M': cout<<"Macaroni Penguin"<<endl;break; case 'L': cout<<"Little Penguin"<<endl; } return 0; } Re: WA2, where is the mistake? Послано 999999 5 апр 2016 20:45 what is test 2? |
|
|