Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
731 B
0
Indexable
Never
#include <iostream>
using namespace std;
const int num_ycheniki = 5;
const int num_ocenki = 5;
int main()
{
    int ocenki[num_ycheniki][num_ocenki];
    for (int i = 0; i < num_ycheniki; i++)
    {
        cout << i + 1 << ':' << endl;
        for (int j = 0; j < num_ocenki; j++)
        {
            cin >> ocenki[i][j];
        }
    }
    for (int i = 0; i < num_ycheniki; i++)
    {
        cout << i + 1 << ':' << endl;
        int sum = 0;
        for (int j = 0; j < num_ocenki; j++)
        {
            cout << ocenki[i][j] << ' ' << endl;
            sum += ocenki[i][j];
        }
        double average = double(sum) / num_ocenki;
        cout << average << endl;
    }
    return 0;
}
Leave a Comment