C++ handwritten gcd function

The function for finding the greatest common factor __gcd in the C++<cmath> library is handwritten as follows:

int gcd(int a,int b)
{
    
    
    return b?gcd(b,a%b):a;
}

Guess you like

Origin blog.csdn.net/m0_51955470/article/details/113911355
gcd