|
|
вернуться в форумWhy WA??? Why??? #include <iostream> #include <cmath> using namespace std; char **ms; int n, EP, LP, MP, A; int main() { cin >> n; ms = new char* [n]; for (int i = 0; i < n; ++i) { ms[i] = new char [30]; } for(int i = 0; i < n; ++i) { cin.sync(); //cin.getline(ms[i], 28); cin >> ms[i]; } for(int i = 0; i < n; ++i) { if (!(strcmp(ms[i], "Emperor"))) EP++; if (!(strcmp(ms[i], "Little"))) LP++; if (!(strcmp(ms[i], "Macaroni"))) MP++; } A = max(EP, LP); A = max(A, MP); if (A == EP)cout << "Emperor Penguin" << endl; if (A == LP)cout << "Little Penguin" << endl; if (A == MP)cout << "Macaroni Penguin" << endl; return 0; } Edited by author 02.10.2011 15:29 |
|
|