Advertisement
Guest User

Untitled

a guest
May 24th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int liczba, suma = 0;
  8.  
  9.     cin >> liczba;
  10.  
  11.     while(liczba != 0)
  12.     {
  13.         suma += liczba;     // zwiększamy sumę o wartość liczba
  14.         cin >> liczba;
  15.     }
  16.  
  17.     cout << suma << endl;
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement