Advertisement
Kazimirko

Основы С++ / Тема 2 / Урок 5. Циклы while и do-while / Задача 1

Feb 14th, 2021
1,366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     int a = 5;
  8.     int b;
  9.     do {  
  10.         cout << "Guess the number: "s << endl;  
  11.         cin >> b;
  12.     } while (a != b);
  13.     cout << "You are right!"s << endl;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement