|
|
back to boardwhat is the 4 test ? Posted by Bekzat 3 Dec 2016 08:28 my code #include <bits/stdc++.h> using namespace std; int main() { int n, c = 0, s = 0, v = 0, maxn = 0; cin >> n; string a, b; for(int i = 1; i <= n; i++){ cin >> a ; for(int i = 0; i <= a.size(); i++){ if(a[0] == 'E' && a[1] == 'm' && a[2] == 'p' && a[3] == 'e' ){ c++; break; } else if( a[0] == 'M' && a[1] == 'a' && a[2] == 'c' && a[3] == 'a'){ s++; break; } else if(a[0] == 'L' && a[1] == 'i ' && a[2] == 't' && a[3] == 't' ){ v++; break; } } cin >> b; } if(c > s && c > v){ cout << "Emperor Penguin"; } else if(s > c && s > v){ cout << "Macaroni Penguin"; } else if(v > c && v > s){ cout << "Little Penguin"; } return 0; } why incorrect |
|
|