#include<stdio.h>
void main()
{
unsigned x,y,a,b,d,e,i;
printf("Please input two numbers:\n");
scanf("%d%d",&x,&y);
a=x;b=y;i=2;d=1;
do
{
for(;!(a%i)&&!(b%i);)
{
a=a/i;
b=b/i;
d=d*i;
}
i++;
}
while(i<=a&&i<=b);
e=(x*y)/d;
printf("zui da gong yue shu:%d\n",d);
printf("zui xiao gong bei shu:%d\n",e);
}
[此贴子已经被作者于2005-11-21 16:37:18编辑过]