64,637
社区成员
发帖
与我相关
我的任务
分享
int lessEmp(const Employee& lh,const Employee& rh)
{
return lh.totalsalary<rh.totalsalary?-1:(lh.totalsalary==rh.totalsalary?0:1);
}
//这样使用sort排序
sort(vectorEmployee.begin(),vectorEmployee.end());
sort(vectorEmployee.begin(),vectorEmployee.end(),lessEmp);