#include <iostream>
#include <iomanip>
using namespace std;
class Student {
public:
Student(string a, int b, int c, int d) {
name = a;
id = b;
score = c;
score_c = d;
}
Student(const Student& a) {
name = a.name;
id = a.id;
score = a.score;
score_c = a.score_c;
}
string name;
int id, score_c, score;
void Disp() {
cout << setw(10) << name << setw(10) << id <<setw(10) << score << setw(10) << score_c << endl;
}
private:
};
void SortStud(Student stud[], int n) {
int i, j;
Student t("张三", 2019001, 60, 78);
for (j = 0; j < n-1; j++) {
C++用类对学生成绩排序
最新推荐文章于 2024-07-17 13:35:02 发布