PAT diary
1. If there are more than one that needs to be sorted
bool cmp1(s s1,s s2)
{
return s1.score == s2.score ? s1.id < s2.id : s1.score > s2.score;
}
2. The erase method of string
string str = "hello c++! +++";
// 删除"+++"前的一个空格
str.erase(str.begin()+10);
cout << '-' << str << '-' << endl;
// 删除"+++"
str.erase(str.begin() + 10, str.end());
cout << '-' << str << '-' << endl;
return 0;