Advertisement
Benjamin_Loison

Random letter's order of a given word and user have to find

Oct 16th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     //1 : On demande de saisir un mot
  8.  
  9.     string mot;
  10.     string cherche;
  11.     string melange;
  12.  
  13.     cout << "Ecrivez un mot on va s'amuser !" << endl << endl;
  14.     cin >> mot;
  15.  
  16.     //2 : On mélange les lettres du mot
  17.  
  18.     //3 : On demande à l'utilisateur quel est le mot mystère
  19.  
  20.     while (cherche != mot)
  21.     {
  22.         cout << endl << "Quel est ce mot ?" << " " << melange << endl << endl;
  23.         cin >> cherche;
  24.     }
  25.  
  26.     if (cherche == mot)
  27.     {
  28.         cout << endl << "Tu as trouve le mot !" << endl;
  29.     }
  30.  
  31.  
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement