- 计算最大公约数(辗转相除法)
// C++ #include#include using namespace std; int test_way1(int Num1,int Num2){ int tmp; if(Num1 附上使用Python递归解法:
def gcd(a,b): while b!=0: b,a = a%b,b return a print(gcd(10,20))

// C++ #include#include using namespace std; int test_way1(int Num1,int Num2){ int tmp; if(Num1 附上使用Python递归解法:
def gcd(a,b): while b!=0: b,a = a%b,b return a print(gcd(10,20))