坤 • 6个月前
int main() {
int n, m, a[105][105], b[105][105], c[105][105];
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
scanf("%d", &a[i][j]);
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
scanf("%d", &b[i][j]);
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
c[i][j] = a[i][j] + b[i][j];
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
printf("%d ", c[i][j]);
}
printf("\n");
}
return 0;
}
评论:
请先登录,才能进行评论