Untitled
twetwunknown
c_cpp
2 years ago
371 B
9
Indexable
#include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "russian");
int a, n, sum = 0;
cout << "Сколько чисел вы хотите ввести:";
cin >> n;
for (int i = 0; i < n; i++)
{
cout << "Введите число:";
cin >> a;
sum += a;
}
cout << (double)sum / n;
}Editor is loading...