// 从小到大排序
sort(records.begin(), records.end(), [](string a, string b){
return a.length() < b.length();
});
自定义静态函数
static bool cmp(string a, string b){
return a.length() < b.length();
}
sort(records.begin(), records.end(), cmp);

// 从小到大排序
sort(records.begin(), records.end(), [](string a, string b){
return a.length() < b.length();
});
自定义静态函数
static bool cmp(string a, string b){
return a.length() < b.length();
}
sort(records.begin(), records.end(), cmp);