看看是不是比大小写错了,我的开始是写成这样子:
bool operator > (const string & x,const string & y){ if(x.size() > y.size()) return 1; //else if(x.size() < y.size())return 0;//忘记写这一行了 else{ for(int i = 0;i < max(x.size(),y.size());++i) { if(x[i] > y[i]) return true; if(x[i] < y[i]) return false; } } return 0; }
就错了