注意点:排名顺序如果有并列,则往后延续比如1 1 1 4 5而不是1 1 1 2 3
每次排序后更新每个学生的最好排名情况。
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <fstream>
using namespace std;
struct Student
{
public:
string id;
int score[4];
int bestRank;
char subject;
Student(string id, int c, int m, int e) : id(id)
{
score[0] = c;
score[1] = m;
score[2] = e;
score[3] = (c + m + e) / 3;
}
};
struct cmpA
{
b......
阅读全文