Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #include <iostream>
  2. #include <String>
  3. #include <algorithm>
  4. using namespace std;
  5. int main()
  6. {
  7.     int Emperor = 0;
  8.     int Little = 0;
  9.     int Macaroni = 0;
  10.     const int maximum = 2001;
  11.     int n;
  12.     cin >> n;
  13.     string mas[maximum];
  14.     for (int x = 0; x < n*2; x++) {
  15.         cin >> mas[x];
  16.     }
  17.     for (int x = 0; x < n*2; x=x+2) {
  18.         if (mas[x][0] == 'E') {
  19.             Emperor++;
  20.         }
  21.         else if (mas[x][0] == 'L') {
  22.             Little++;
  23.         }
  24.         else {
  25.             Macaroni++;
  26.         }
  27.     }
  28.     if (Emperor > Little && Emperor > Macaroni) {
  29.         cout << "Emperor Penguin";
  30.     }
  31.     else if (Little > Emperor && Little > Macaroni) {
  32.         cout << "Little Penguin";
  33.     }
  34.     else {
  35.         cout << "Macaroni Penguin";
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement