본문 바로가기

코딩/백준

파이썬: 백준문제 5086번, 배수와 약수

728x90
반응형

 

 

 

 

while 1:
    a,b = map(int,input().split())
    
    if a == 0 and b == 0:
        break
        
    if a>b:
        if a%b == 0:
            print('multiple')
        else:
            print('neither')
    else:
        if b%a == 0:
            print('factor')
        else:
            print('neither')
            
 

 

반응형