IT 공부/코딩테스트
[백준 10178번] 할로윈의 사탕 - 파이썬
unnimm
2023. 7. 30. 17:21
해설
몫과 나머지로 출력하는 문제이다.
풀이
n = int(input())
for i in range(n):
c, v = map(int, input().strip().split())
print('You get {} piece(s) and your dad gets {} piece(s).'.format(c//v, c % v))
for i in range(n):
c, v = map(int, input().strip().split())
print('You get {} piece(s) and your dad gets {} piece(s).'.format(c//v, c % v))
format함수를 이용해서 넣었음