我有这样一个向量:
struct StatFaces
{
std::string faceName_1;
std::string faceName_2;
float percentagePerson ;
};
std::vector<StatFaces> listFaces_;
我想对该向量进行排序。但是我想用组对其进行排序。例如..
I have faceName_1 = john , faceName_2 = kate , percentagePerson = %90
faceName_1 = john , faceName_2 = nastia , percentagePerson = %95
faceName_1 = bill , faceName_2 = jamie , percentagePerson = %91
faceName_1 = bill , faceName_2 = anna , percentagePerson = %72
output should be ;
faceName_1 = bill , faceName_2 = jamie, percentagePerson = %91
faceName_1 = bill , faceName_2 = anna , percentagePerson = %72
faceName_1 = john , faceName_2 = nastia , percentagePerson = %95
faceName_1 = john , faceName_2 = kate , percentagePerson = %90
排序算法必须先分组firstName_1,然后按照percentagePerson排序
ps:我不擅长c++