int main()
{
int a = 0;
int b = 0;
int c = 0;
scanf("%d%d", &a, &b);
if (a % b == 0)
{
if (a > b)
{
printf("%d\n", b);
}
else
{
printf("%d\n", a);
}
}
else
{
while (a % b)//a%b!=0
{
c = a % b;
a = b;
b = c;
}
printf("%d\n", c);
}
return 0;
}
标签:while,int,scanf,d%,求其,else,最大公约数,给定,printf
From: https://blog.51cto.com/u_16329505/8182381