https://www.myziyuan.com/

- wolf8668
- 我自己写的,你自己看一下,修改:#include <iostream>#include <string>#include <iomanip>#include <algorithm>using namespace std;enum Lesson{math, physics, english};struct Student{ string name; // 姓名 int id; // 学号 int grade_NO; int class_NO; int mathscore, physicsscore, englishscore; Student * next;};class StudentsList{public: StudentsList():head(NULL), total(0){} ~StudentsList(); // 析构函数 Student* insert(Student* pstu); // 插入一个学生的信息 int remove(int id); // 根据学号删除学生 int remove(string name); // 根据姓名删除学生 Student* modify(Student* pstu); // 修改一个学生的学号 Student* find(string name); // 根据名字寻找一个学生 Student* find(int id); // 根据学号寻找学生 void printbynameorder(); // 按照姓名的字典序排序 void printbyidorder(); // 按照学号升序排序 void printbyscoreorder(Lesson lesson = math); // 按照某门课程的成绩降序排序 void printone(Student *pstu); // 输出一个学生的信息 void printbyclass(int NO); // 输出某个班级的全部学生 void printbyidrange(int from, int to); // 输出学号范围的学生 void printtabletitle(){cout << setw(16) << "姓名" << setw(6) << "学号" << setw(6) << "年级" << setw(6) << "班级" << setw(10) << "入学数学成绩" << setw(10) << "入学物理成绩" << setw(10) << "入学英语成绩" << endl;} Student* input();protected:private: Student *head; int total;}; int mathscorecompare(const Student* a1, const Student* a2) {return a1->mathscore - a2->mathscore;} int physicsscorecompare(const Student* a1, const Student* a2){return a1->physicsscore - a2->physicsscore;} int englishscorecompare(const Student* a1, const Student* a2){return a1->englishscore - a2->englishscore;} Student* StudentsList::insert(Student *pstu) // 按照学号的顺序进行插入{ if (head == NULL) {head = pstu;head->next = NULL;total++;return head; } if (pstu->id < head->id) {pstu->next = head;head = pstu;total++;return head; } Student *a1, *a2; a1 = head; a2 = a1->next; while (a2 != NULL && pstu->id >= a2->id) {a1 = a2;a2 = a1->next; } a1->next = pstu; pstu->next = a2; total++; return pstu;}StudentsList::~StudentsList(){ Student *a1; while (head != NULL) {a1 = head;head = a1->next;delete a1;total--; }}int StudentsList::remove(int id) // 根据学号删除学生{ if (head == NULL) {cout << "There is any student in the list, can not remove.\n";return 1; } Student *a1, *a2; if (head->id == id) {a1 = head;head = a1->next;delete a1;total--;return 0; } else {a1 = head;a2 = head->next;while (a2 != NULL && a2->id != id){a1 = a2;a2 = a2->next;}if (a2 != NULL && a2->id == id){a1->next = a2->next;delete a2;total--;return 0;}elsereturn 1; }}int StudentsList::remove(string name) // 根据名字删除学生{ if (head == NULL) {cout << "There is any student in the list, can not remove.\n";return 1; } Student *a1, *a2; if (head->name == name) {a1 = head;head = a1->next;delete a1;return 0; } else {a1 = head;a2 = head->next;while (a2 != NULL && a2->name != name){a1 = a2;a2 = a2->next;}if (a2 != NULL && a2->name == n签名系统ame){a1->next = a2->next;delete a2;return 0;}elsereturn 1; }}Student* StudentsList::modify(Student* pstu) // 修改学生信息{ Student *a1 = head; while (a1 != NULL && a1->name != pstu->name && a1->id != pstu->id)a1 = a1->next; if (a1->name == pstu->name && a1->id == pstu->id) {a1->name = pstu->name;a1->id = pstu->id;a1->name = pstu->name;a1->grade_NO = pstu->grade_NO;a1->class_NO = pstu->class_NO;a1->mathscore = pstu->mathscore;a1->physicsscore = pstu->physicsscore;a1->englishscore = pstu->englishscore;return a1; } return NULL;}Student* StudentsList::find(string name) // 根据名字寻找学生{ Student *a1 = head; while (a1 != NULL && a1->name != name)a1 = a1->next; if (a1 != NULL && a1->name == name) {return a1; } elsereturn NULL;}Student* StudentsList::find(int id) // 根据学号寻找学生{ Student *a1 = head; while (a1 != NULL && a1->id != id)a1 = a1->next; if (a1 != NULL && a1->id == id) {return a1; } elsereturn NULL;}void StudentsList::printbynameorder() // 按照姓名的升序进行排序{ }void StudentsList::printbyidorder() // 按照学号的升序输出学生{ Student *pstu = head; if (pstu == NULL) {cout << "There is any student in the list." <<endl;return; } while (pstu != NULL) {printone(pstu);pstu = pstu->next; }}void StudentsList::printbyscoreorder(Lesson lesson) // 按照某一个学科的成绩降序输出学生信息,默认为数学成绩{ if (head == NULL) {cout << "There is not exsit any student." << endl;return; } if (!(math <= lesson && lesson <= physics)) {cout << "There is not exsit leeson NO " << lesson << "." << endl;return; } Student **a = new Student*[total]; // ? Student *pstu = head; int i = 0; while (pstu != NULL) {a[i++] = pstu;pstu = pstu->next; } if (lesson == math) {sort(a, a+total, mathscorecompare); } else if (lesson == physics) {sort(a, a+total, physicsscorecompare); } else if (lesson == english) {sort(a, a+total, englishscorecompare); } printtabletitle(); for (i = 0; i < total; i++) {printone(a[i]); } cout << endl; delete a;}void StudentsList::printone(Student* pstu) /// 输出一个学生的信息{/* cout << "姓名:" << pstu->name << " 学号:" << pstu->id << " 年级:" << pstu->grade_NO << " 班级:" << pstu->class_NO << " 入学数学成绩:" << pstu->mathscore << " 入学物理成绩:" << pstu->physicsscore << " 入学英语成绩:" << pstu->englishscore << ".\n"; */ cout << setw(16) << pstu->name << setw(6) << pstu->id << setw(6) << pstu->grade_NO << setw(6) << pstu->class_NO<< setw(10) << pstu->mathscore << setw(10) << pstu->physicsscore << setw(10) << pstu->englishscore << endl;}void StudentsList::printbyclass(int NO) // 输出某个班级的学生{ Student *pstu = head; bool flag = false; while (pstu != NULL ) {if (pstu->class_NO == NO){if (false == flag){printtabletitle();flag = true;}printone(pstu);}pstu = pstu->next; } if (false == flag) {cout << "There is not exsit class " << NO << endl; } else {cout << endl; }}void StudentsList::printbyidrange(int from, int to) // 按照学号范围输出{ Student *pstu = head; while (pstu != NULL && pstu->id < from)pstu = pstu->next; if (pstu == NULL) {cout << "Can't print by id from " << from << " to " << to << endl;return; } while (pstu != NULL && pstu->id <= to) {printone(pstu);pstu = pstu->next; }}Student* StudentsList::input() // 一个简单的输入{ Student *pstu = new Student; cout << "(Format:姓名 学号 年级 班级 入学数学成绩 入学物理成绩 入学英语成绩)\nInput:"; cin >> pstu->name >> pstu->id >> pstu->grade_NO >> pstu->class_NO >> pstu->mathscore >> pstu->physicsscore >> pstu->englishscore; pstu->next = NULL; return pstu; //insert(pstu);} int main(){ Student *pstu; StudentsList stulist; char ch; int id; string name; bool quit = false; while (false == quit) {cout << "\ninsert(i), delete(d), find(f), print(p), view(v), quit(q):";cin >> ch;switch (ch){case 'i':pstu = stulist.input();stulist.insert(pstu);break;case 'd':cout << "Please input student's name:";cin >> name;stulist.remove(name);break;case 'f':cout << "Please input student's id:";cin >> id;pstu = stulist.find(id);stulist.printone(pstu);break;case 'p':break;case 'v':stulist.printbyscoreorder(math);break;case 'q':quit = true;break;default:break;} } return 0;}
- 2021-12-12 14:10:37
- 510167024
- 帐户是ID号码,您可以直接登录!如果忘记密码,您可以尝试使用密码检索登录密码。您还可以致电当地的学生资助管理中心让员工帮助重置密码。扩大数据国家学生贷款是党中央委员会和国务院在社会主义市场经济的条件下,利用财政意义来改善我国的大学资助政策制度,并增加学生对贫困的努力的重大措施高校。国家学生贷款是占主导地位的,财政,财政和大学,为银行,银行,教育主管部门和大学为大学贫困家庭共同运营银行贷款。借用学生不需要处理贷款担保或抵押贷款,但需要根据计划偿还并承担相关的法律责任。借用学生通过学校申请银行贷款,使用d为了弥补学校期间的成本不足,他们将在毕业后偿还。2012年8月8日,新援助贷款的发展将超过120亿元。2015年7月20日,教育部和其他部门发布了“关于完善国家学生贷款政策的一些意见”。“意见”说,为了有效降低借贷学生的经济负担,最长的贷款期限为14岁至20年。它也从2年到3年的2年延伸。。参考:自学贷款
- 2021-12-12 14:09:31
- wolf8668
- 国家开发银行学生在线服务系统怎么进不去,有可能系统忙 或者学校已给你注册过 用身份证号登录密码出生年月日8位 还不行就到学校助贷中心问问 重置密码 还有可能是浏览器有问题 用IE6.0以上
- 2021-12-12 14:09:31