#include<stdio.h>
#include<math.h>
main()
{int i,j,k,l,a,b;
printf("\nplease input two number:\n");
scanf("%d%d",&a,&b);
i=1;j=1;
while(a/i!=b/j)
{while(a/i>b/j)
i++;
while(a/i<b/j)
j++;
}
printf("The zuidagongyueshu of two number is %d\n",a/i);
i=1;j=1;
while(a*i!=b*j)
{while(a*i>b*j)
j++;
while(a*i<b*j)
i++;
}
printf("The zuixiaogongbeishu of two number is %d\n",a*i);
}
[此贴子已经被作者于2006-8-14 21:07:37编辑过]