OJ-Problems-Source/OpenJudge/ch0202_冰封/7592.c
2016-07-06 14:15:22 +08:00

18 lines
310 B
C

#include<stdio.h>
#include<stdlib.h>
int fafafa(long a,long b){
if(a%b == 0) return b;
return fafafa(b, a%b);
}
int main(void){
long i,j;
//i = 100; j = 10;
scanf("%ld%ld",&i,&j);
if(i<j){long t = i; i = j;j = t;}
printf("%ld",fafafa(j,i));
//system("PAUSE");
return 0;
}