看不懂的WHILE循环!
#include <stdio.h>int main()
{ int a,b,c; /*计算a+b*/
while(scanf("%d,%d",&a,&b)!=2)fflush(stdin);
c=a+b;
printf("%d+%d=%d",a,b,c);
}
摘自卧龙孔明整理编辑的"C语言精华资料集合"如何处理scanf()函数误输入造成程序死锁或出错?
请问while(scanf("%d,%d",&a,&b)!=2)是啥意思啊?
2008-03-09 00:02
2008-03-09 00:14
2008-03-09 09:49
2008-03-09 12:36
2008-03-09 12:42
2008-03-09 13:41
2008-03-10 13:36

2008-03-10 14:39

2008-03-10 17:42
2008-03-10 18:50