Advertisement
MeehoweCK

Untitled

Aug 14th, 2019
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     unsigned liczba;
  8.     unsigned ilosc_liczb = 0;
  9.     unsigned suma = 0;
  10.    
  11.     if(ilosc_liczb < 10)
  12.     {
  13.         cin >> liczba;
  14.         suma += liczba;     // zwiększamy wartość zmiennej suma o wartość zmiennej liczba
  15.         ++ilosc_liczb;        
  16.     }
  17.    
  18.     cout << "Suma wczytanych liczb wynosi " << suma << endl;
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement