You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
207 B
20 lines
207 B
12 months ago
|
int fun(int m,int n){
|
||
|
int rem;
|
||
|
while(n > 0){
|
||
|
rem = m % n;
|
||
|
m = n;
|
||
|
n = rem;
|
||
|
}
|
||
|
return m;
|
||
|
}
|
||
|
int main(){
|
||
|
int n,m;
|
||
|
int num;
|
||
|
m=getint();
|
||
|
n=getint();
|
||
|
num=fun(m,n);
|
||
|
putint(num);
|
||
|
|
||
|
return 0;
|
||
|
}
|