23 lines
329 B
C++
23 lines
329 B
C++
|
#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);
|
||
|
}
|