看到一个比较精炼的最大公约数算法:
public static int gcd(int a, int b){ return b==0 ? a : gcd(b, a % b); }
最大公约数算法
原文:http://www.cnblogs.com/qj4d/p/7220135.html