求最大公因数
while 1:s = input('請輸入一個數:')e = input('請輸入一個數:')s = int(s)e = int(e)if s == 0 or e == 0:print('錯誤')continueif s > e:f = eelse:f = swhile f:if s % f == 0 and e % f == 0:print(f)breakelse:f = f - 1
?
轉載于:https://www.cnblogs.com/wumac/p/5678306.html
總結
- 上一篇: hdu 4864 Task(贪婪啊)
- 下一篇: Spring与Hibernate整合中,