it

[파이썬] 백준 5086번 배수와 약수

두두100 2022. 4. 5. 11:52

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

 

5086번: 배수와 약수

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

www.acmicpc.net

while True:
    n,m=map(int,input().split())
    if (n==0)|(m==0):
        break
    elif m%n==0:
        print('factor')
    elif n%m==0:
        print('multiple')
    else:
        print('neither')