mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
29 lines
390 B
C
29 lines
390 B
C
|
/*
|
|||
|
<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;
|
|||
|
}
|