有个小疑问
#include<stdio.h>int main(void)
{
int a,b;
printf("please input two number: ");
scanf("%d,%d",&a,&b);
if(a > b?a:b)
{
printf("a大于b");
}
else
{
printf("a小于b");
}
return 0;
}
这个完全自己写的,我想比较a和b大小,然后输出大的那个数,为什么结果总是a大于b。
2013-06-15 16:02
2013-06-15 16:58
2013-06-15 16:59
程序代码:#include<stdio.h>
int main(void)
{
int a,b;
printf("please input two number: ");
scanf("%d,%d",&a,&b);
a > b?printf("a大于b\n"):printf("a小于b\n");
return 0;
}

2013-06-15 20:40
2013-06-15 21:07
2013-06-15 21:21
2013-06-16 11:09
2013-06-16 15:07
2013-06-16 15:09
2013-06-16 15:12