最大公约数,GCD

1
2
3
4
5
int gcd(int a,int b)
{
    if(b==0)return a;
    return gcd(b,a%b);
}