Princeqi @ 2020-10-05 21:46:18
#include<stdio.h>
#include<stdlib.h>
struct QAQ
{
char s[8];
int a,b,c;
}p[1000];
int main()
{
int i,N,sum[1000],max,z;
scanf("%d",&N);
for(i=1;i<=N;i++)
{
scanf("%s%d%d%d",&p[i].s,&p[i].a,&p[i].b,&p[i].c);
sum[i]=p[i].a+p[i].b+p[i].c;
}
max=sum[1];
z=1;
for(i=1;i<=N;i++)
{
if(sum[i]>max)
{
max=sum[i];
z=i;
}
}
printf("%s %d %d %d",p[z].s,p[z].a,p[z].b,p[z].c);
return 0;
}
by metaphysis @ 2020-10-06 12:53:13
@Princeqi
#include<stdio.h>
#include<stdlib.h>
struct QAQ
{
char s[12];
int a,b,c;
}p[1010];
int main()
{
int i,N,sum[1010],max,z;
scanf("%d",&N);
for(i=1;i<=N;i++)
{
scanf("%s%d%d%d",&p[i].s,&p[i].a,&p[i].b,&p[i].c);
sum[i]=p[i].a+p[i].b+p[i].c;
}
max=sum[1];
z=1;
for(i=1;i<=N;i++)
if(sum[i]>max)
{
max=sum[i];
z=i;
}
printf("%s %d %d %d",p[z].s,p[z].a,p[z].b,p[z].c);
return 0;
}
by ZtoZero @ 2020-10-16 17:02:35
第三个点姓名是10字符