69,336
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
void main()
{
int x, y, tmp, multiple;
printf("Input two numbers:\n");
printf("x = ");
scanf("%d", &x);
printf("y = ");
scanf("%d", &y);
multiple = x * y;
if(x > y)
{
tmp = x;
x = y;
y = tmp;
}
while(x != 0)
{
tmp = y % x;
y = x;
x = tmp;
}
multiple = multiple / y;
printf("maximum common divisor is %d\n", y);
printf("min common multiple is %d\n", multiple);
}