递归
ll gcd(ll a,ll b)
{
return b==0 ? a : gcd(b,a%b);
}
非递归
ll gcd(ll a,ll b)
{
while(b)
{
ll tmp=a%b;
a=b;
b=tmp;
}
return a;
}
ll gcd(ll a,ll b)
{
return b==0 ? a : gcd(b,a%b);
}
ll gcd(ll a,ll b)
{
while(b)
{
ll tmp=a%b;
a=b;
b=tmp;
}
return a;
}