main 是int类型,图里写错,问题没变
求解。难道是 << >> 这两个符号要手动重载?印象中不要啊
写反了吧,cin >>, cout <<
cin是>>
cout才是<<
好吧。。。。眼瞎
你这程序问题有点多。
#include
#include
using namespace std;
int main()
{
string s;
cin>>s;
cout<<s<<endl;
return 0;
}
main函数前面的返回类型不应该是string类型,应该是int类型,
cin后面跟的运算符应该是>>,cout后面跟的运算符是<<
这两个运算符你写反了。
改后的代码:
#include <iostream>
#include <string>
using namespace std;
int main(void)
{
string s;
cin >> s;
cout << s << "\n";
return 0;
}
int main{
cout <<
cin >>
}
你写反了,哥哥