MeehoweCK

Untitled

Dec 31st, 2022
1,239
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.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int suma = 0;
  8.     int liczba;
  9.  
  10.     do
  11.     {
  12.         cin >> liczba;
  13.         suma += liczba;
  14.     } while(liczba != 0 && suma <= 20);     // != oznacza nierówność
  15.  
  16.     cout << "Suma wczytanych liczb wynosi " << suma << endl;
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment