while 1: s = input('请输入一个数:') e = input('请输入一个数:') s = int(s) e = int(e) if s == 0 or e == 0: print('错误') continue if s > e: f = e else: f = s while f: if s % f == 0 and e % f == 0: print(f) break else: f = f - 1