__gcd()函数


       在翻别人的题解的时候偶然发现了这个函数,然后就去查了查,但是相关内容不多,__gcd(x,y);好像是GNU的内部函数,不是一个标准库里的函数,我也不太了解,平时写题直接用这个函数挺方便的,当然也可以手写gcd函数,它头文件是algorithm。


#include <iostream>
#include <algorithm>
using namespace std;
int a,b;

int main()
{
  cin>>a>>b;
  cout<<__gcd(a,b)<<endl;
  return 0;
}

猜你喜欢

转载自blog.csdn.net/charles_zaqdt/article/details/80944060
gcd
今日推荐