暴力枚举
#include <iostream>
#include <algorithm>
using namespace std;
int gcd(int a, int b);
int main()
{
int x, y;
cin >> x >> y;
cout << gcd(x, y) << endl;
return 0;
}
int gcd(int a, int b){
int m = min(a,b);
for(int i = m; m > 0; i--)
{
if(a % i == 0 && b % i == 0)
{
return i;
break;
}
}
}