Files
python/TangDou/XiTi/1079.cpp

34 lines
716 B
C++
Raw Normal View History

2025-08-30 18:35:01 +08:00
#include <bits/stdc++.h>
using namespace std;
int main() {
int a[3][3] = {0};
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
cin >> a[i][j];
}
}
//左上右下
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
//左上右下
if (i == j) {
a[i][j] += 10;
}
// 左下右上
if (i + j == 2) {
a[i][j] += 10;
}
}
}
//输出
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
cout << a[i][j] << " ";
}
cout << endl;
}
return 0;
}