Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <set>
- #include <fstream>
- #include <string>
- using namespace std;
- int main()
- {
- ifstream input;
- input.open("input.txt");
- string s;
- set <string> ans;
- pair <string, int> num;
- num.second = 0;
- num.first = "";
- while (!input.eof()) {
- input >> s;
- if (isdigit(s[0]) && num.second == 0) {
- num.first = s;
- num.second = 1;
- }
- else if (s == num.first) {
- num.second++;
- }
- }
- for (set<string>::iterator it = ans.begin(); it != ans.end(); it++) {
- cout << *it << " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement