解题思路:
注意事项:
参考代码:
def matrix(n, m, A, B):
result_matrix = []
for i in range(n):
row_result = []
for j in range(m):
row_result.append(A[i][j] + B[i][j])
result_matrix.append(row_result)
return result_matrix
n, m = map(int, input().split())
A = []
for _ in range(n):
row_A = list(map(int, input().split()))
A.append(row_A)
B = []
for _ in range(n):
row_B = list(map(int, input().split()))
B.append(row_B)
result = matrix(n, m, A, B)
for row in result:
print(*row)
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:732 |
C语言程序设计教程(第三版)课后习题6.4 (C语言代码)浏览:738 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:482 |
C语言训练-大、小写问题 (C语言代码)浏览:724 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:513 |
简单的for循环浏览:1408 |
【偶数求和】 (C语言代码)浏览:556 |
C语言程序设计教程(第三版)课后习题8.6 (C语言代码)浏览:564 |
1014题解浏览:484 |
简单的a+b (C语言代码)浏览:574 |