파이썬/Algorithms
백준(BAEKJOON) 2720 세탁소 거스름돈 - 파이썬(python)
hanshow113
2021. 9. 9. 11:16
N = int(input())
q, d, n, p = 25, 10, 5, 1
for i in range(N):
c = int(input())
print(c//q, (c%q)//d, (c%q%d)//n, (c%q%d%n)//p, sep=' ')
# 동전을 달러 단위로 표현된 그대로 했더니 제출 시 틀렸다고 나옴
N = int(input())
q, d, n, p = 0.25, 0.1, 0.05, 0.01 # coins
for i in range(N):
c = int(input()) / 100 # cent to dollar
print(int(c // q), int(round((c % q), 2) // d), int(round((c % q % d), 2) // n), int(round((c % q % d % n), 2) // p), sep=' ')