Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main()
- {
- int n, q = 0, z = 0;
- cin >> n;
- vector <string> x(n);
- for (int i = 0; i < n; ++i) {
- getline(cin, x[i]);
- cout << x[i] << "\n";
- z = 1;
- for (int j = 0; j < i; ++j) {
- if (x[i] == x[j]) z++;
- }
- if (z > q) q = z;
- }
- cout << q;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment