python概述練習

一、輸入兩個數值, 求兩個數的最大公約數和最小公倍數. 最大公約數就是A和B能整除的最大的數; 求最大公約數和最小公倍數算法: def count(a, b): if a < b: a, b = b, a while b != 0: divisor = a % b a = b b = divisor return a a = int(input(
相關文章
相關標籤/搜索