Programming/Python & Data Structures
[Baekjoon/Python3] 5086번 배수와 약수
HooNeee
2020. 12. 5. 20:53
[Baekjoon/Python3] 5086번 배수와 약수
5086번: 배수와 약수
각 테스트 케이스마다 첫 번째 숫자가 두 번째 숫자의 약수라면 factor를, 배수라면 multiple을, 둘 다 아니라면 neither를 출력한다.
www.acmicpc.net
a, b = 0, 0
while True:
a, b = map(int, input().split())
if a == 0 and b == 0:
break
else:
if b % a == 0:
print('factor')
elif a % b == 0:
print('multiple')
else:
print('neither')