Advertisement
MeehoweCK

Untitled

Dec 17th, 2020
719
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. // Napisz program, który pobiera od użytkownika dziesięć liczb całkowitych, po czym wypisuje ich sumę na ekran
  6.  
  7. int main()
  8. {
  9.     int liczba;
  10.     int suma = 0;
  11.    
  12.     cout << "Podaj 10 liczb calkowitych: ";
  13.     for(int i = 0; i < 10; ++i)
  14.     {
  15.         cin >> liczba;
  16.         suma += liczba;
  17.     }
  18.    
  19.     cout << "Suma podanych liczb wynosi " << suma << endl;
  20.    
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement