请问这段程序的错误是什么意思不明白?
#include"iostream.h"
void main()
{ int x,y,,z,big;
cout<<"input x,y and z please:"<<endl;
cin>>x>>y>>z;
big=x>y ? x:y> ? y:z;
cout<<"The max is:"<<big<<endl;
}
错误是什么意思?
--------------------Configuration: tt - Win32 Debug--------------------
Compiling...
f.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\tt\f.cpp(3) : error C2059: syntax error : ','
C:\Program Files\Microsoft Visual Studio\MyProjects\tt\f.cpp(5) : error C2065: 'z' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\tt\f.cpp(6) : error C2065: 'big' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\tt\f.cpp(6) : error C2059: syntax error : '?'
执行 cl.exe 时出错.
tt.exe - 1 error(s), 0 warning(s)
参考答案:C:\Program Files\Microsoft Visual Studio\MyProjects\tt\f.cpp(3) : error C2059: syntax error : ','
C:\Program Files\Microsoft Visual Studio\MyProjects\tt\f.cpp(5) : error C2065: 'z' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\tt\f.cpp(6) : error C2065: 'big' : undeclared identifier
主要是你{ int x,y,,z,big;这一行的Y后面多了一个逗号,syntax error 指语法错误;undeclared identifier 指无法识别的定义;
C:\Program Files\Microsoft Visual Studio\MyProjects\tt\f.cpp(6) : error C2059: syntax error : '?' 执行 cl.exe 时出错.
这一行指你因为上一个错误导致编译出错.