Advertisement
chevengur

Вводный курс: основы C++ | Урок 5: Циклы while и do-while

Aug 22nd, 2023 (edited)
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 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