Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int n, x,a=1;
  6. double srednia;
  7.  
  8. int main()
  9. {
  10.  
  11.     cout << "Podaj liczbe n: " << endl;    cin >> n;
  12.  
  13.  
  14.     for(int i = 1; i<=n; i++)
  15.     {
  16.         cout << endl;
  17.         cout << "Podaj liczbe n:" << endl;      cin >> x;
  18.         cout << endl;
  19.        
  20.         srednia = (n+x)/a++;
  21.         cout << endl;
  22.         cout << srednia;
  23.     }
  24.  
  25.        
  26.  
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement