求两个数的最大公约数

来源:互联网 发布:区域软件 编辑:程序博客网 时间:2024/04/30 01:42


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

}

0 0
原创粉丝点击