본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 27130번 Long Multiplication

by 현장 2024. 6. 20.

-Code

n1 = int(input())
n2 = input()
res = 0
print(n1)
print(n2)
for i in range(1, len(n2) + 1):
    temp = n1 * int(n2[-i])
    print(temp)
    res += temp * (10 ** (i - 1))
print(res)