#include <iostream>
using namespace std;
int gcd(int a, int b);
int main()
{
int m,j;
cout<<"请输入两个人数:";
cin>>m>>j;
cout<<gcd(m,j)<<endl;
return 0;
}
int gcd(int a, int b)
{
if(a>=b)
{
if(a%b==0)
return b;
else{
b=b-1;
gcd(a,b);
}
}
if(a<b){
if(b%a==0)
return a;
else
{
a=a-1;
gcd(a,b);
}
}