要求用C++实现如下:1)课程的增加、修改和删除、查询2)学生成绩的增加、修改、删除、查询3)统计所有学生每门功课的平均值、最大值、最小值4)统计单个学生的所有课程的平均值、最大值和最小值
#include "pch.h" #include <iostream> #include <string> #include <vector> #include <map> #include <algorithm> #include <iostream> #include <fstream> using namespace std; class Student { public: string name; string id; vector<pair<string, int>> scores; Student(string& n, string& i) { name = n; id = i; scores = vector<pair<string, int>>(); } Student() { name = ""; id = ""; scores = vector<pair<string, int>>(); } void add_score(pair<string, int>& s) { scores.push_back(s); } void print() { cout << "name:" << name << " id:" << id << endl; for (auto i : scores) {