初学C语言,不知道这个程序为什么不对,求助!
# include <stdio.h>int main (void)
{
int a, b, r;
printf("请输入两个数(以逗号隔开):\n");
scanf("%d, %d", &a, &b);
if (b > a)
r = a;
a = b;
b = r;
while (r != 0)
{
r = a%b;
if (r > b)
a = r;
else
a = b;
b = r;
}
printf("他们的最大公约数是%d\n", a);
return 0;
}
我不知道哪错了,请高手们指点!