Guest User

zastępowanie słów

a guest
Jan 8th, 2015
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     string temp = "";
  10.     string temp2 = "";
  11.     vector<string> disliked;
  12.     int i = 0;
  13.  
  14.     cout << "Podaj slowa ktorych nie lubisz:" << endl;
  15.  
  16.     while(cin >> temp)
  17.         disliked.push_back(temp);
  18.  
  19.     cout << "Wpisz slowo:" << endl;
  20.  
  21.     while(cin >> temp2)
  22.     {
  23.         for(i = 0; i < disliked.size(); ++i)
  24.         {
  25.             if(temp2 == disliked[i])
  26.             {
  27.                 cout << "Biippp!";
  28.                 break;
  29.             }
  30.         }
  31.     }
  32.  
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment