Advertisement
CLazStudio

q1861616686

Mar 15th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3.  
  4. using namespace std;
  5.  
  6. int main ()
  7. {
  8.     setlocale (LC_ALL, "Russian");
  9.     int a, sum = 0, f;
  10.  
  11.     cout << "Кол-во чисел: ";
  12.     cin >> a;
  13.     int *s = new int[a];
  14.  
  15.     for (int i = 0; i < a; i++)
  16.     {
  17.         cout << "Введите " << i + 1 << " число: ";
  18.         cin >> s[i];
  19.         sum += s[i];
  20.     }
  21.  
  22.     f = sum/a;
  23.     cout << "Среднее число: " << f << endl;
  24.     _getch ();
  25.     delete []s;
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement