haju__log

[python][백준/BOJ] 5086번 : 배수와 약수 본문

BOJ_백준

[python][백준/BOJ] 5086번 : 배수와 약수

haju 2023. 3. 10. 16:07
반응형

https://www.acmicpc.net/problem/5086

 

5086번: 배수와 약수

각 테스트 케이스마다 첫 번째 숫자가 두 번째 숫자의 약수라면 factor를, 배수라면 multiple을, 둘 다 아니라면 neither를 출력한다.

www.acmicpc.net

반응형
while True:
    a,b=map(int,input().split())
    if a==0 and b==0:
        break
    if b%a==0:
        print("factor")
    elif a%b==0:
        print("multiple")
    else:
        print("neither")
반응형