hyjhyj111 @ 2023-10-13 20:22:24
#include<stdio.h>
int sum(int x,int y,int z)
{
return x + y + z;
}
int max(int x,int y)
{
if(x < y) return y;
return x;
}
int main()
{
int n,d[1010] = {0},x[1010],y[1010],z[1010],s[1010] = {0};
char c[1010][10],l = '1';//d为第i行中名字的个数,xyz为成绩,
scanf("%d",&n);//s为成绩和
scanf("%c",&l);//l用来判断名字读入完没有和读入换行
for(int i = 1;i <= n;i++)
{
for(int j = 1;;)
{
scanf("%c",&l);
if(l != ' ')
{
c[i][j] = l;
j++;
d[i] = j - 1;
}
else
{
break;
}
}
scanf("%d %d %d",&x[i],&y[i],&z[i]);
scanf("%c",&l);
s[i] = sum(x[i],y[i],z[i]);
}
int t = 0;
for(int i = 1;i <= n;i++)
{
t = max(t,s[i]);
}
for(int i = 1; i <= n;i++)
{
if(s[i] == t)
{
t = i;
break;
}
}
for(int i = 1;i <= d[t];i++)
{
printf("%c",c[t][i]);
}
printf(" %d %d %d",x[t],y[t],z[t]);
return 0;
}