int gcd(int a, int b)
{
    return b ? gcd(b, a%b) : a;
    //方法2:
    //if(a%b == 0) return b;
    //return gcd(b, a%b);
}