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 bellmanford @ 2020-05-22 21:12:16
头像好评
by 子翮 @ 2020-05-22 21:13:20
头像好评(
by zzx0826 @ 2020-05-22 21:14:48
@ruichen 第八个点被火箭砸了
by JohnVictor @ 2020-05-22 21:17:42
@hans_yuan 电车不怕电法,也不怕雷龙,下一个
by JohnVictor @ 2020-05-22 21:26:41
@bellmanford 哇 你 也 玩 皇 战
by bellmanford @ 2020-05-22 22:56:10
@JohnVictor 是的,话说您的账号皮卡羊的英文到底是什么啊(
火箭表示不服
by Aragron_II @ 2020-05-23 08:18:09
皇室玩家真多啊
by Aragron_II @ 2020-05-23 08:18:40
@JohnVictor 加个这个:
https://www.luogu.com.cn/team/26803
好吗