holo_23 @ 2022-12-24 15:43:00
#include<stdio.h>
#include<stdlib.h>
struct stu{
char name[10];
int score[3];
int total;
}stu[1000];
int main()
{
int max,n;
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%s%d%d%d",stu[i].name,&stu[i].score[0],&stu[i].score[1],&stu[i].score[2]);
}
for(int i=0;i<n;i++)
{
for(int j=0;j<3;j++)
{
stu[i].total+=stu[i].score[j];
}
}
for(int i=0;i<n;i++)
{
max=0;
if(stu[i].total>stu[max].total)
max=i;
}
printf("%s %d %d %d",stu[max].name,stu[max].score[0],stu[max].score[1],stu[max].score[2]);
}
by Fsdyofficial @ 2022-12-24 15:48:25