#include<iostream>
#include<iomanip>
#include<string.h>
#include<stdio.h>
#include<stdlib.h>
#include<vector>
#include<stdio.h>
#include<algorithm>
#include<cmath>
using namespace std;
struct stu{
string name;
int li;
int shi;
}student[1010];
int cmp(const void*x,const void*y){
struct stu* xx = (struct stu*)x;
struct stu* yy = (struct stu*)y;
return (yy->li+yy->shi)-(xx->li+xx->shi);
}
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>student[i].name>>student[i].li>>student[i].shi;
}
qsort(&student[0], sizeof(student) / sizeof(student[0]), sizeof(student[0]), cmp);
for(int j=0;j<n;j++){
cout<<student[j].name<<endl;
}
}
}
为什么这会有问题?