python 2整数の最大公約数を求める
a = int(input("input a ="))
b = int(input("input b ="))
if a < b:
divisor = a
else:
divisor = b
while divisor > 1:
print("divisor = " + str(divisor))
if a % divisor == 0 and b % divisor == 0:
break
divisor -= 1
print("最大公約数は" + str(divisor))
※インデントがないため、コピペでは動きません!