最快求出两数最大公约数的代码,看看是不是和你的一样

#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
int a, b, c;
scanf("%d", &a);
scanf("%d", &b);
while (c = a % b)
{
b = c;
a = b;
}
printf("%d\n", b);
system(“pause”);
return 0;
}

猜你喜欢

转载自blog.csdn.net/ZhangaZhaoLong/article/details/82891352
今日推荐