# b가 0이어도 0이 아니어도, 출력값이 a인 것은 변하지 않음
# 따라서, 출력값을 경우의 수를 나눌 필요없이, 한 번에 a라고 해도 됨
# 두 번째 방법은 안 쓰는게 나을듯
a = int(input())
b = int(input())
while b != 0:
R = a % b
a = b
b = R
print(a)
# a = int(input())
# b = int(input())
# if (b == 0):
# print(a)
# else:
# R = a % b
# while (R != 0):
# R = a % b
# a = b
# b = R
# print(b)
To embed this project on your website, copy the following code and paste it into your website's HTML: