/*** 用recursive(遞迴)方式 求GCD(Greatest Common Divisor) ***/ //by Wen-Nung Tsai #include #include #define repeat do{ #define until(e) }while(!(e)) #define mod % long gcd(long m, long n); /*求最大公因數*/ int main() { long x,y; /* 不叫 m,n 也沒關係啦 */ cout << "Find GCD of two numbers. Program stops when one of the input is 0\n"; repeat cout <<" First number=? "; cin >> x; /* 輸入資料到變數 x */ cout <<" Second number=? "; cin >> y; cout<< x <<" 和 "<