src2020/1664_gongyue/main.cpp

23 lines
329 B
C++
Raw Normal View History

#include <iostream>
using namespace std;
void dg(int bei,int chu){
if(bei%chu==0){
cout<<chu;
return;
}else{
dg(chu,bei%chu);
}
}
int main()
{
int yi,er;
cin>>yi>>er;
if(yi<er){
int u;
u=yi;
yi=er;
er=u;
}
dg(yi,er);
}