포스트

[Python] Baekjun #2588 - Multiplication

We have organized a solution in Python that separates each digit and outputs the intermediate multiplication result and final value.

한국어 원문은 여기에서 볼 수 있습니다.
[Python] Baekjun #2588 - Multiplication

BaekJoon 2588

Solution

1
2
3
4
5
6
7
8
9
a = int(input())
b = int(input())

c = a * (b%10)
d = a * ((b%100)//10)
e = a * (b//100)
f = a * b

print("%d\n%d\n%d\n%d" % (c, d, e, f))

Unlike before, the input is not in the form of "345 678", but in the form of "345\n678", The list format split() cannot be used, and input was received separately as input().