Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- using namespace std;
- int main ()
- {
- setlocale (LC_ALL, "Russian");
- int a, sum = 0, f;
- cout << "Кол-во чисел: ";
- cin >> a;
- int *s = new int[a];
- for (int i = 0; i < a; i++)
- {
- cout << "Введите " << i + 1 << " число: ";
- cin >> s[i];
- sum += s[i];
- }
- f = sum/a;
- cout << "Среднее число: " << f << endl;
- _getch ();
- delete []s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement