#include <iostream>
using namespace std;
signed main(){
const int n = 5;
int a[n][n];
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
cin >> a[i][j];
for(int i = 0; i < n; i++){
double cur_sum = 0;
cur_sum += a[i][j];
cout << "average mark of " << i + 1 << " student is " << cur_sum / n << "\n";
}
Поделитесь своими знаниями, ответьте на вопрос:
1 Дана таблица оценок 5 учеников по 5 предметам. Найти среднюю оценку по каждому ученику
#include <iostream>
using namespace std;
signed main(){
const int n = 5;
int a[n][n];
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
cin >> a[i][j];
for(int i = 0; i < n; i++){
double cur_sum = 0;
for(int j = 0; j < n; j++)
cur_sum += a[i][j];
cout << "average mark of " << i + 1 << " student is " << cur_sum / n << "\n";
}
}