标题:Java中使用欧几里得求最大公约数 /** * 求最大公约数 * @author dell * */ public class TestGcd { public int hh(int m,int n) { if(m<n) { return hh(n,m); }else if(n==0) { return m; }else { return hh(n,m%n); } } @Test public void test() { int hh = this.hh(16, 18); System.out.println("hh:"+hh); } }