提交时间:2023-08-04 19:44:22

运行 ID: 24078

#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; }