请高手帮我看看我编的公约数和公倍数的运行时总报Divide error?
#include"stdio.h"main()
{
int a,b,a1,b1,i,m,n;
printf("put in 2 num:\n");
scanf("%d,%d",&a,&b);
a1=a;
b1=b;
if(a1<b1)
{
i=a1; a1=b1; b1=i;
}
m=a1%b1;
while(m)
{
a1=b1;
b1=m;
m=a1%b1;
}
printf("the max is:%d\nthe min is:%d\n",m,n=a*b/m);
}