输入三个正整数,输出这三个数的最小公倍数。
输入:15 18 93
输出:2790
#include<stdio.h>
int main()
{
int a,b,c,temp;
scanf_s("%d %d %d", &a, &b, &c);
if (a < b)
temp = b;
else
temp = a;
if (temp < c)
temp = c;
for (int i = temp; i <=a*b*c; i++)
{
if (i % a == 0)
if (i % b == 0)
if (i % c == 0)
{
printf("最小公倍数:%d", i);
break;
}
}
return 0;
}