其他分享
首页 > 其他分享> > [PAT][Basic level]1034

[PAT][Basic level]1034

作者:互联网

KeyWords:GCD(greatest common divisor);

#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int gcd(int a,int b){
    return a%b?gcd(b,a%b):b;
}
int main()
{
    int m , n;
    cin>>m>>n;
    
    cout<<"The Greatest common divisor of m and n is "<<gcd(m,n)<<endl;
    return 0;
}

标签:std,main,PAT,gcd,level,int,a%,include,1034
来源: https://blog.csdn.net/qq_38103468/article/details/117669992