Start: Jan, 08, 2018 19:10:00
2017年秋季学期程序设计基础(C语言)期末考试
End: Jan, 08, 2018 21:40:00
Time elapsed:
Time remaining:

Problem_ID: E
Result: Accepted
Time: 15ms
Memory: 1092kB
In contest: 1139

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct student{
	char name[100];
	int q1,q2,q3;
};	
int main(){
	int t,a,temp,g;
	int n;
	char *b[100];
	int max=0;
	
	struct student p[200];
	scanf("%d",&t);
	while(t>0){
		scanf("%d",&a);
		for(int i=0;i<a;i++){
		scanf("%s",p[i].name);
	    scanf("%d%d",&p[i].q1,&p[i].q2);
		p[i].q3=p[i].q1+p[i].q2;}
		for(int j=0;j<a;j++){
		for(int i=0;i<a;i++){
			if(p[i].q3>max){
				max=p[i].q3;
				g=i;}}
			printf("%s\n",p[g].name);
			p[g].q3=0;
			max=0;}
		
		t=t-1;}
	//system("pause");
	return 0;}