wjh1677848426 @ 2017-05-06 14:16:05
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int n,s,w,x=0,h=1,j,k,i=1; //个数,数学,外语 ,获奖者 ,学号
cin>>n;
int z[n+1],y[n+1]; //总分,语文
for(i=1;i<=n;i++){
cin>>y[i]>>s>>w;
z[i]=y[i]+s+w;
}
j=1;
do{
i=j;h=1;
k=z[j];
while(i<n)
{if((k<z[i+1]))
{k=z[i+1];h=i+1;
}i++;
} cout<<h<<" "<<k<<endl;z[h]=0;x++;
}while(x<5);
return 0;
}