#include<stdio.h>
#include<math.h>
void main()
{
int m,n,a,b,t;
scanf("%d%d",&a,&b);
a=fabs(a);
b=fabs(b);
m=a;
n=b;
while(b>0)
{
t=a%b;
a=b;
b=t;
}
t=m*n/a;
printf("%d %d",a,t);
}
求最大公约数和最小公倍数
最新推荐文章于 2024-07-16 11:07:08 发布