求最大公约数,用欧几里得算法(辗转相除法)。
int gcd(int a,int b){ return b==0 ? a : gcd(b,a%b); }
求最大公约数
原文:http://www.cnblogs.com/shenchuguimo/p/6359851.html