Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
436 B
0
Indexable
Never
#include <iostream>
using namespace std;

int main()
{
	const int n = 5;
	int uch[n][n];
	for (int i = 0; i < n; i++)
	{
		for (int k = 0; k < n; k++)
		{
			cin >> uch[i][k];
		}
	}
	double sr[5] = {};
	int summ = 0;
	for (int i = 0; i < n; i++)
	{
		summ = 0;
		for (int k = 0; k < n; k++)
		{
			summ += uch[i][k];
		}
		sr[i] = summ / 5.0;
	}
	for (int i = 0; i < n; i++)
	{
		cout << sr[i] << " ";
	}
}
Leave a Comment