Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
24078 LeeHao 期末成绩-二维数组 C++ 通过 0 MS 248 KB 540 2023-08-04 19:44:22

Tests(1/1):


#include <bits/stdc++.h> using namespace std; int main() { int a[3][2] = {}; for (int row = 0; row <= 2; row++) { for (int col = 0; col <= 1; col++) { cin >> a[row][col]; } } int z1=0, z2=0, z3=0; for (int col = 0; col <= 1; col++) { z1 += a[0][col]; z2 += a[1][col]; z3 += a[2][col]; } int y = 0, s = 0; for (int row=0; row <= 2; row++) { y += a[row][0]; s += a[row][1]; } cout << z1 << " " << z2 << " " << z3 << endl; cout << round(y / 3.0) << " " << round(s * 1.0 / 3); return 0; }


测评信息: