/*
*/
#include<stdio.h>
#include<algorithm>
using namespace std;
struct stu{
char number[18];
int shi,kao;
}arr[1005];
bool cmp(stu A,stu B){
return A.shi<B.shi;
}
int main(){
int N,N1,temp;
scanf("%d",&N);
for(int i=1;i<=N;i++){
scanf(" %s %d %d",arr[i].number,&arr[i].shi,&arr[i].kao);
}
sort(&arr[1],&arr[N+1],cmp);
scanf("%d",&N1);
for(int i=0;i<N1;i++){
if(i!=0) printf("\n");
scanf("%d",&temp);
printf("%s %d",arr[temp].number,arr[temp].kao);
}
return 0;
}
转载于:https://www.cnblogs.com/hebust/p/9498026.html