c语言小白,没看出自己的错在哪!
题目:#include<stdio.h>
main()
{
int n=0;
while((ch=getchar())!='!')
{
if(ch=='\n')
n++;
}
printf("%d",n);
return 0;
}
问题;
--------------------Configuration: u - Win32 Debug--------------------
Compiling...
u.cpp
G:\vc6.0\Microsoft Visual Studio\MyProjects\t\u.cpp(5) : error C2065: 'ch' : undeclared identifier
执行 cl.exe 时出错.
u.obj - 1 error(s), 0 warning(s)