#include<iostream>
using namespace std;
int main()
{
int a, b, min,answer;
while (cin >> a >> b)
{
if (a < b)
{
min = b;
}
if (a>b)
{
min = a;
}
for (int i = 1; i <min; i++)
{
if (a%i == 0 && b%i == 0)
{
answer = i;
}
}
cout << answer << endl;
}
system("pause");
return 0;
}
拜託大家了