error C2676: binary '<<' : 'class std::basic_istream<char,struct std::char_traits<char> >' does not

#include <iostream>
using namespace std;
int main( )
{int x,y;
cin<<x;
if (x<1) y=x;
else if (x>=1&&x<10) y=2*x-1;
else y=3*x-11;
cout<<"y="<<y<<endl;
return 0;
}
编译出来错误为:error C2676: binary '<<' : 'class std::basic_istream<char,struct std::char_traits<char> >' does not define this operator or a conversion to a type acceptable to the predefined operator
执行 cl.exe 时出错.

第1个回答  推荐于2018-05-17
输入的时候cin后边的输入流符号写错了
应该是cin>>x 而不是cin<<x本回答被网友采纳
第2个回答  2010-09-21
cin<<x; error

cin>>x; right本回答被提问者采纳