请各位看看,为什么运行结果不对
题目:输入两个正整数m和n,求其最大公约数和最小公倍数。我输入75 35 结果是3 和75 为什么?
# include <stdio.h>
main ()
{
int a, b, num1, num2,temp;
printf("please input two numbers: \n");
scanf("%d ,%d", &num1, num2);
if (num1<num2)
{
temp = num1;
num1 = num2;
num2 = temp;
}
a = num1;
b = num2;
while(b != 0)
{
temp = a%b;
a = b;
b = temp;
}
printf ("gongyueshu:%d \n", a);
printf ("goneyueshu:%d \n", num1*num2 / a);
getchar ();
return 0;
}