int main()
{
int num1 = 0;
int num2 = 0;
int a = 0;
scanf("%d%d", &num1, &num2);
while (a = num1 % num2)
{
num1 = num2;
num2 = a;
}
printf("公约数为%d\n", num2);
return 0;
}
运用了辗转相除法的运算思路
标签:num1,num2,int,scanf,d%,while,C语言,最大公约数,给定 From: https://blog.51cto.com/u_15801317/5728297