cxzzzz @ 2020-12-01 20:08:10
int main()
{
int x,i,max,p;
int a[3001];
int c[1001];
char b[1001];
while(~scanf("%d",&x)){
for(i=1;i<=x;i++)
scanf("%s %d %d %d",&b[i+1],&a[i*3+1],&a[i*3+2],&a[i*3+3]);
for(i=1;i<=x;i++)
c[i]=a[i*3+1]+a[i*3+2]+a[i*3+3];
max=c[1];
p=1;
for(i=2;i<=x;i++)
if(max<c[i])
{max=c[i];
p=i;}
printf("%s %d %d %d\n",b[p],a[p*3+1],a[p*3+2],a[p*3+3]);
}
return 0;
}```
by Godのfather @ 2020-12-01 20:12:00
scanf("%s %d %d %d",&b[i+1],&a[i*3+1],&a[i*3+2],&a[i*3+3]);
读入字符串不用"&"
by cxzzzz @ 2020-12-01 20:13:58
@Godのfather 谢谢大佬的解答