<span style="font-size:18px;color:#cc66cc;background-color: rgb(255, 255, 255);">#include<stdio.h>
int fun(int a,int b)
{
int c;
c = a%b;
if(c)
{
a = b;
b = c;
c = a%b;
}
return b;
}
int main(void)
{
printf("%d\n",fun(1,7));
printf("%d\n",fun(4,8));
printf("%d\n",fun(0,7));
return 0;
} </span>
编写一个函数,传入a,b两个int类型的变量,返回两个值的最大公约数
最新推荐文章于 2022-10-16 11:16:10 发布