Advertisement
Guest User

Untitled

a guest
May 19th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <string>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     vector<string*> document;
  9.     string input;
  10.  
  11.     cin >> input;
  12.     document.push_back(new string(input));
  13.  
  14.     while(input != "Q")
  15.     {
  16.         cin >>  input;
  17.         int docsize = document.size();
  18.         for(int i = 0; i < docsize; i++)
  19.         {
  20.             if(*document[i] == input)
  21.             {
  22.                 document.push_back(document[i]);
  23.                 break;
  24.             }
  25.             else
  26.             {
  27.                 document.push_back(new string(input));
  28.                 break;
  29.             }
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement