问题详情

设变量已正确定义 , 以下不能统计出一行中输入字符个数 ( 不包含回车符 ) 的程序段是

A)n=0;while((ch=getchar())!='\n')n++;

B)n=0;while(getchar()!='\n')n++;

C)for(n=0;getchar()!='\n';n++);

D)n=0;for(ch=getchar();ch!='\n';n++);

参考答案
您可能感兴趣的试题