[BOJ / Python] 2738 행렬 덧셈

도니·2023년 4월 6일

BOJ / Python

목록 보기
44/105
post-thumbnail

문제

백준 2738 행렬 덧셈

코드

#BOJ 2738 행렬 덧셈

n, m = map(int, input().split())
a, b = [], []

for i in range(n):
    x = list(map(int, input().split()))
    a.append(x)
    
for i in range(n):
    y = list(map(int, input().split()))
    b.append(y)

for i in range(n):
    for j in range(m):
        print(a[i][j] + b[i][j], end = " ")
    print()

✅ n, m 어디에 사용하는지 주의!

profile
Where there's a will, there's a way

0개의 댓글