/*如果b等于0,计算结束,a就是最大公约数;
否则,计算a除以b的余数,让a等于b,而b等于那个余数*/
#include<stdio.h>
int main()
{
int a;
int b;
int t;
scanf("%d %d",&a,&b);
while(b!=0)
{
t=a%b;
a=b;
b=t;
}
printf("gcd=%d",a);
return 0;
}
11-26
7万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
01-07
11-29