Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <vector>
- #include <algorithm>
- #include <string>
- #include <fstream>
- #include <sstream>
- #include <set>
- #include <map>
- using namespace std;
- ifstream in("input.txt");
- ofstream out("output.txt");
- int main() {
- map<int, int> mc;
- map <string, int> ms;
- string s;
- int ps = 0;
- while (in >> s) {
- bool f = 1;
- for (auto x : s) {
- if (!isdigit(x)) {
- f = 0;
- break;
- }
- }
- if (f) {
- mc[stoi(s)]++;
- ps = stoi(s);
- }
- else {
- ms[s]++;
- }
- }
- for (auto x : ms) {
- if (x.second == mc[ps]) {
- out << x.first << endl;
- }
- }
- }
- soup soup soup soap soap 3 4 4 4 5 soap soap soup 4 skr skr karych liza skr popova skr
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement