C++ 这段程序怎么错了啊?

来源:百度知道 编辑:UC知道 时间:2024/06/22 15:46:35
#include<iostream>
#include<numeric>
#include<fstream>
#include<string>
#include<vector>
#include<list>
#include<deque>
#include<algorithm>
#include<stack>
#include<queue>
#include<utility>
#include<sstream>
#include<iterator>
#include<map>
using namespace std;
bool jj(const string &kk,const string &uh)
{
return kk.size() < uh.size();
}
int main()
{
vector<string> bb;
string hh;
cout<<"please enter :"<<endl;
cin>>hh;
while(hh!="#")
{
bb.push_back(hh);
cin>>hh;
}
if(bb.begin()==bb.end())
{
cout<<"wrong!!!!"<<endl;
main();
}
vector<string>::iterator ss=unique(bb.begin(),bb.end());
bb.erase(ss,bb.end());
sort(bb.begi

很多都不是程序本身的问题, 而是编译器不能很好的支持标准C++,所以很多东西明明是对的, 编译器就报错,建议下个能对标准c++支持比较好的编译器试试。
补充一下,我用的就是vc++ 6.0的, 这个编译器对标准支持的不好, 很多标准的东西都不支持,申明友元还要前向申明,模板不支持分别编译等等。
像你用的那个函数, 它库里可能根本就没有,就像sort的三个参数的版本的, 就也不行,搞得我要用一堆的代码去修改,你可以试试,祝你好运。

什么书啊