daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest May 19th, 2017 41 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
Top