__gcd-最大公约数

__gcd-最大公约数函数

  1. 最大公约数(greatest common divisor,简写为gcd;或highest common factor,简写为hcf)
  2. __gcd(x,y)是algorithm库中的函数

#include<cstdio>
#include<algorithm>
using namespace std;
int n,m;
int main()
{
    scanf("%d %d",&n,&m);
    int k=__gcd(n,m);//最大公约数
    printf("%d",k);
    return 0;
}spa

相关文章
相关标签/搜索