#include?"stdio.h"
void?main()
{
int?a,b,c,d,num;
printf("Input?tow?numbers\n");
scanf("%d%d",&a,&b);
if(a<b){??????//將大值賦給了a
c=a;
a=b;
b=c;
}
num=a*b;?????//求公倍數
while(b!=0){
c=a%b;
a=b;
b=c;
}
printf("最大公因數:%d\n",a);
printf("最小公倍數:%d\n",num/a);
????
}
- 1 回答
- 0 關注
- 1402 瀏覽
添加回答
舉報
0/150
提交
取消