#include <iostream>
#include <algorithm>
#include <cstring>
#include <queue>
using namespace std;
/*
求两个数的最大公约数
示例:
输入:6,27
输出:3
*/
//欧几里德除法
int main(){
int a,b;
while(1){
cout << "输入两个数:" ;
cin >> a >> b;
int dd = a>b ? a : b;
int d = a<b ? a : b;
int r = dd % d;
while(r!=0){
dd = d;
d = r;
r = dd % d;
}
cout << "最大公约数为: " << d << endl;
}
return 0;
}