Advertisement
MeehoweCK

Untitled

Nov 16th, 2020
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int liczba, suma = 0;
  8.  
  9.     for(int i = 0; i < 10; ++i)
  10.     {
  11.         cin >> liczba;
  12.         suma += liczba;     // suma = suma + liczba
  13.     }
  14.     cout << "Suma podanych liczb wynosi " << suma << endl;
  15.     cout << "Srednia podanych liczb wynosi " << 0.1 * suma << endl;
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement