while(scanf("%d%d",&a,&b)!
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/10 13:57:17
while(scanf("%d%d",&a,&b)!
EOF=end of file 这回你知道什么意思了吧
scanf函数的返回值说明.
Returns the number of fields successfully converted and assigned; the return value does not include fields that were read but not assigned. A return value of 0 indicates that no fields were assigned.
If format is a NULL pointer, the invalid parameter handler is invoked, as described in Parameter Validation. If execution is allowed to continue, these functions return EOF and set errno to EINVAL.
EOF就是-1,是在stdio.h里定义的.
按照上面的说明,scanf函数只有在第一个参数为NULL(空指针)的情况下,才可能返回EOF,否则,返回成功格式化并赋值的参数个数(>=0).
所以,楼主你的这个循环,将是一个死循环.
scanf函数的返回值说明.
Returns the number of fields successfully converted and assigned; the return value does not include fields that were read but not assigned. A return value of 0 indicates that no fields were assigned.
If format is a NULL pointer, the invalid parameter handler is invoked, as described in Parameter Validation. If execution is allowed to continue, these functions return EOF and set errno to EINVAL.
EOF就是-1,是在stdio.h里定义的.
按照上面的说明,scanf函数只有在第一个参数为NULL(空指针)的情况下,才可能返回EOF,否则,返回成功格式化并赋值的参数个数(>=0).
所以,楼主你的这个循环,将是一个死循环.
while(scanf("%d%d",&a,&b)!
while(scanf("%d%d",&a,&b)!=EOF,a||b)
while( scanf("%d%d%d",&a,&b,&c)!=EOF)是什么意思?
while(scanf("%d %d %ld",&a,&b,&n),a+b+n),为什么可以这样表达?
scanf("%d",&a); scanf("%c",&c); scanf("%d",%b); scanf("%d %c
比如:while(scanf("%d%d",&a,&b)!=EOF)这句是什么意思?
scanf("%d%d",&a,
素数 回文数#includemain(){ int i,n,a,b,c,d,j,count; while (scanf(
while (scanf("%d/%d",&i,&j),
while(scanf("%d",&m)!=EOF)
scanf("%d %d",&a, &b) != EOF是什么意思
while (scanf("%d%d", &m, &n))什么意思?