[BaekJoon] 2738번: 행렬 덧셈 (Python)
- Reference
- N, M 헷갈려서 계속 런타임 에러 떴음
Solution
N, M = map(int, input().split())
l1 = []
for _ in range(N):
tmp1 = list(map(int, input().split()))
l1.append(tmp1)
l2 = []
for _ in range(N):
tmp2 = list(map(int, input().split()))
l2.append(tmp2)
for i in range(N):
for j in range(M):
print(l1[i][j] + l2[i][j], end=' ')
print()
Leave a comment