[Python] Baekjun #2588 - Multiplication
Multi-line input handling in Python, and step-by-step multiplication implementation using string indexing and arithmetic operations
한국어 원문은 여기에서 볼 수 있습니다.
[Python] Baekjun #2588 - Multiplication
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().