Advertisement
chevengur

Вводный курс: основы C++ | Урок 7: Выход из цикла 1/2

Aug 22nd, 2023 (edited)
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     for (int i = 0; i < 10; ++i) {
  6.         int x;
  7.         std::cin >> x;
  8.         if (x == 1) {
  9.             cout << "Om-nom-nom :P" << endl;
  10.         }
  11.         else {
  12.             cout << "No cake :(" << endl;
  13.             break;
  14.         }    
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement