#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
//最大公约数 24 % 18 == 6
int main()
{
int a = 0;
int b = 0;
scanf("%d %d", &a, &b);
while (a % b)//当a%b==0时,表达式为假,跳出循环
{
int c = a % b;
a = b;
b = c;
}
printf("%d",b);
return 0;
}
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
//最大公约数 24 % 18 == 6
int main()
{
int a = 0;
int b = 0;
scanf("%d %d", &a, &b);
while (a % b)//当a%b==0时,表达式为假,跳出循环
{
int c = a % b;
a = b;
b = c;
}
printf("%d",b);
return 0;
}