Guest User

Untitled

a guest
Dec 2nd, 2015
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5.  
  6. int main()
  7. {
  8.     int n, q = 0, z = 0;
  9.     cin >> n;
  10.     vector <string> x(n);
  11.     for (int i = 0; i < n; ++i) {
  12.         getline(cin, x[i]);
  13.         cout << x[i] << "\n";
  14.         z = 1;
  15.         for (int j = 0; j < i; ++j) {
  16.             if (x[i] == x[j]) z++;
  17.         }
  18.         if (z > q) q = z;
  19.     }
  20.     cout << q;
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment