#include <stdio.h>
int ret(int x, int y)
{
int i = 1;
if (x % y == 0 || y % x == 0)
return(x > y ? x : y);
else
{
for(i=1;i<=x*y;i++)
{
i = x*i;
if (i % y == 0)
{
return i;
}
}
}
}
int main()
{
int arr1[5] = { 0 };
int i = 0, k = 0, j = 0;
for (i = 0; i < 3; i++)
{
scanf_s("%d", &arr1[i]);
}
for (j = 0; j < i - 2; j++)
{
int ret(int x, int y);
k = ret((ret(arr1[j], arr1[j + 1])), arr1[j + 2]);
}
printf("%d\n", k);
return 0;
}
标签:return,公倍数,++,个数,最小,ret,int,arr1 From: https://blog.51cto.com/u_16336886/8741799