求各路C语言大神
发布网友
发布时间:2023-08-09 14:51
我来回答
共1个回答
热心网友
时间:2023-10-06 04:46
#include <stdio.h>
/************found************/
fun(int x, int y,int z)
{ int j,t,n,m;
/************found************/
j=1;
t=j%x;
m=j%y;
n=j%z;
while(t!=0||m!=0||n!=0)
{ j=j+1;
t=j%x;
m=j%y;
n=j%z;
}
/************found************/
return j;
}
main()
{
int x1,x2,x3,j;
printf("Input x1 x2 x3: ");scanf("%d%d%d",&x1,&x2,&x3);
printf("x1=%d,x2=%d,x3=%d\n",x1,x2,x3);
j=fun(x1,x2,x3);
printf("The minimal common multiple is :%d\n",j);
}