Advertisement
Infiniti_Inter

Задача 7

May 23rd, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <vector>
  4. #include <string>
  5. #include <map>
  6. using namespace std;
  7.  
  8.  
  9.  
  10. ifstream fin("input.txt");
  11. ofstream out("output.txt");
  12.  
  13. int main()
  14. {
  15.     map<string, int> a;
  16.     vector<string> b;
  17.     while (fin.peek() != EOF)
  18.     {
  19.         string s;
  20.         fin >> s;
  21.         b.push_back(s);
  22.         a[s]++;
  23.     }
  24.     for (int i = 0; i < b.size(); ++i)
  25.     {
  26.         if (a[b[i]] == 1)
  27.             out << b[i] << endl;
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement