Silver Library (Archived)
Baekjoon algorithm - 10430 , python (map) 본문
Use 'map' to its initial list.
This allows programmer to let list acts multiple value aggregately.
As long as I know how map works out, I can finally achieve the simplicity (from refactoring process)
Error 1.
a,b,c = input().split()
a = int(a)
b = int(b)
c = int(c)
print((A+B)%C, ((A%C) + (B%C))%C, (A×B)%C, ((A%C) × (B%C))%C)
Result = Runtime error (NameError)
Note.
I guess this means 'as long as I wish to perform them all simultaneously, I have to use 'map'.
Check 1.
a,b,c = input().split()
a = int(a)
b = int(b)
c = int(c)
print((A+B)%C)
print((A%C) + (B%C))%C
print((A*B)%C)
print(((A%C) * (B%C))%C)
Note.
Yeah, definitely not. And messy.
Solution.
A,B,C = map(int,input().split())
print((A+B)%C, ((A%C) + (B%C))%C, (A*B)%C, ((A%C) * (B%C))%C, sep='\n')
dojang.io/mod/page/view.php?id=2286
www.educba.com/python-nameerror/
'F2. Problem & Solving > Solving' 카테고리의 다른 글
[JS] Day 1 : let and const (0) | 2021.06.11 |
---|---|
Plan of learning the algorithm (0) | 2021.05.01 |
baekjoon algorithm - 10869 (0) | 2021.02.15 |
Baekjoon algorithm - 1008, python (0) | 2021.02.15 |
Baekjoon - problem 1001, Python (0) | 2021.02.15 |