#include <stdio.h>
int main()
{
int common(int x,int y);
int multiple(int x, int y); //声明函数
int x , y , c , m;
printf("input two number:");
scanf("%d%d",x, y);
printf("output its:\n");
printf("%d,%d",c , m);
return 0;
}
int multiple(int , int )
{
int common(int , int );
int x , y , m ,c;
m = x*y / c; //最小公倍数;用两数相乘除以最大公约数得;
return (m);
}
int common(int , int ) //求最大公约数;辗转相除法
{
int x , y , c , r, t;
if(x > y) {t = x; x = y ; y = t;} //把x,y从从小到大进行排序;
while(x != 0)
{
r = x % y;
y = x;
x = r;
}
c = x;
return (c);
}