OJ-Problems-Source/CodeVS/1212_冰封.c

29 lines
390 B
C
Raw Normal View History

2016-07-06 14:28:18 +08:00
/*
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:ǧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD>Ŀ:p1212 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD>
*/
#include <stdio.h>
long get(long x, long y){
long max = x < y ? y : x;
long min = x > y ? y : x;
if(!(max % min)){
return min;
}
long i;
for(i = max / 2; i > 1; i--){
if(!(x % i) && !(y % i)){
return i;
}
}
return 1;
}
int main(int argc, char* argv[]){
long a, b;
scanf("%i%i", &a, &b);
printf("%i", get(a, b));
return 0;
}