ruichen @ 2020-05-22 20:40:43
帮忙看一下,只错了第8个点啊.....
#include<bits/stdc++.h>
using namespace std;
struct stud{
int ch,ma,en,no,all;
}a[100005];
bool cmp(stud a,stud b){
if(a.all!=b.all)return a.all>b.all;
else if(a.ch!=b.ch)return a.ch>b.ch;
else if(a.ma!=b.ma)return a.ma>b.ma;
else if(a.en!=b.en)return a.en>b.en;
else return a.no<b.no;
}
int n;
int main(){
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>a[i].ch>>a[i].ma>>a[i].en;
a[i].all=a[i].ch+a[i].ma+a[i].en;
a[i].no=i;
}
sort(a+1,a+1+n,cmp);
for(int i=1;i<=5;i++)
{
cout<<a[i].no<<" "<<a[i].all<<endl;
}
return 0;
}
by UltiMadow @ 2020-05-22 20:43:28
@ruichen 仔细读题!仔细读题!仔细读题!
by 吴勉之 @ 2020-05-22 20:43:28
第八个点是雷法,过不去的
by 吴勉之 @ 2020-05-22 20:44:20
@ruichen 读题+1
别自作主张搞什么语文完数学,数学完英语之类的。。。。。。就语文一个好吗
by gigo_64 @ 2020-05-22 20:44:28
建议_(:з」∠)_等压火球秒了雷法再做题
by 吴勉之 @ 2020-05-22 20:45:50
那就再来个来个骷军
by thomas_zjl @ 2020-05-22 20:50:39
头像好评
by Aragron_II @ 2020-05-22 20:51:27
头像好评
by Aragron_II @ 2020-05-22 20:51:40
电法登场
by Aragron_II @ 2020-05-22 20:52:51
第八个点是雷电飞龙和电法造的,过不了的
by chenpengda @ 2020-05-22 21:03:27
谔谔,奇怪的言论增加了!