jiguangdi @ 2023-10-13 21:38:39
#include<string>
using namespace std;
int main(){
int a,b[1000],c[1000],d[1000],i=0,f[1000],z;
cin>>a;
string e[1000];
while(a--)
{
cin>>e[i]>>b[i]>>c[i]>>d[i];
f[i]=b[i]+c[i]+d[i];
i++;
}
for(int k=1;k<=a;k++)
{
if(f[0]<f[k])
{
f[0]=f[k];
z=k;
}
}
cout<<e[z]<<b[z]<<c[z]<<d[z];
return 0;
}
by jiguangdi @ 2023-10-13 23:13:47
@2022zhangyuanhao @heyx0201 过了过了哈哈哈,我发现a在循环中变为了-1,然后数组开小了,然后数组还得开到主函数o外面哈哈谢谢了 @K_cp2312