728x90
반응형

입력을 n으로 나누었을 때 나머지가 0이라면 입력은 n의 배수이다. 0이 아니라면 배수가 아니다.

n = int(input())
while 1:
    t = int(input())
    if t == 0:
        break
    if t % n != 0:
        print('{0} is NOT a multiple of {1}.'.format(t, n))
    else:
        print('{0} is a multiple of {1}.'.format(t, n))

728x90
반응형

+ Recent posts