Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int x, y[10000], z, i;
  4. int main()
  5. {
  6.     cout << "Podaj ilosc liczb (minimum 3)" << endl;
  7.     cin >> x;
  8.     for (i = 0; i < x; i++)
  9.     {
  10.         cout << "Podaj " << i+1 << " liczbe" << endl;
  11.         cin >> y[i];
  12.     }
  13.     z += y[1] + y[x-2];
  14.     cout << "Srednia wynosi " << z / 2 << endl;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement