Advertisement
Guest User

Untitled

a guest
Apr 1st, 2020
130
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 <ctime>
  3. #include <cstdlib>
  4.  
  5. using namespace std;
  6.  
  7. int main(){
  8.  
  9.     srand(time(NULL));
  10.  
  11.     int magic = rand()%100 + 1;
  12.  
  13.     int guess;
  14.  
  15.     do{
  16.         cout << "Dose Arithmo vlaka: ";
  17.         cin >> guess;
  18.  
  19.         if(guess == magic){
  20.             cout << "Bravo kolofarde!" << endl;
  21.         }
  22.         else{
  23.             cout << "LATHOS AXRISTE!";
  24.             if (guess > magic)
  25.                 cout << "Poli megalo arithmo edoses" << endl;
  26.             else
  27.                 cout << "Edoses mikro arithmo, san to pouli sou" << endl;
  28.         }
  29.     }while (guess != magic);
  30.  
  31.     return 0;
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement