文章
119
粉丝
68
获赞
92
访问
20.1k
#include <bits/stdc++.h>
using namespace std;
struct Score{
string name;
int id;
int chinese,math,english;
Score():name(""),chinese(0),math(0),english(0),id(0){}
Score(string name,int chinese,int math,int english,int id):name(name),chinese(chinese),math(math),english(english),id(id){}
bool operator <(Score b){
if(chinese+math+english==b.chinese+b.math+b.english){
if(chinese==b.chinese){
if(math==b.math){
if(english==b.english){
return id<b.id;
}else return english>b.english;
}else return math>b.math;
}else return chinese>b.chinese;
}else return chinese+math+english>b.chinese+b.math+b.english;
}
void print(){
cout<<name;
printf(" %d %d %d\n",chinese,math,english);
}
};
int main() {
int n;
while(cin>>n){
std::vecto...
登录后发布评论
暂无评论,来抢沙发