Advertisement
MeehoweCK

Untitled

Apr 9th, 2021
512
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     unsigned liczba;        // ostatnio wczytana liczba
  8.     unsigned suma = 0;      // suma dotychczas wczytanych liczb
  9.  
  10.     for(short i = 0; i < 10; ++i)
  11.     {
  12.         cin >> liczba;
  13.         suma += liczba;
  14.     }
  15.  
  16.     cout << "Suma wpisanych liczb wynosi " << suma << endl;
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement