#include<stdio.h>
int f(int x,int y,int z)
{
int a,b,c,s,d,h;
a=x;b=y;c=z;
while(x!=y)
{
if(x>y) x=x-y;
else y=y-x;
}
s=a*b/x;
d=s;
while(s!=z)
{
if(s>z) s=s-z;
else z=z-s;
}
h=d*c/s;
return h;
}
int main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
printf("%d",f(a,b,c));
return 0;
}
C语言 辗转相减法 三个数的最小公倍数
猜你喜欢
转载自blog.csdn.net/qq_46232829/article/details/105002223
今日推荐
周排行