#include<iostream>
#include<cstdio>
using namespace std;
int gcd(int a,int b){
return b==0?a:gcd(b,a%b);
}
void read(){
freopen("gcd.in","r",stdin);
freopen("gcd.out","w",stdout);
}
int main(){
read();
int a,b;
scanf("%d%d",&a,&b);
cout<<gcd(a,b);
}
原文地址:https://www.cnblogs.com/1129-tangqiyuan/p/8474520.html
时间: 2024-10-30 07:57:00