C++学生成绩管理系统课程设计报告(10)
发布时间:2021-06-06
发布时间:2021-06-06
bool stuscore::delete_record() {
string s;
student*current,*previous; current=previous=head;
cout<<"成绩表中有"<<length()<<"个学生成绩记录"<<endl; if(!length()) {
cout<<"学生成绩表已空!\n"; return false; } else{
cout<<"请输入要删除的学生记录的学号:" cin>>s; while(current) {
if(current->number==s) {
if(current==head) {
head=head->next; delete current; cout<<"删除成功!"; return true; } else {
previous->next=current->next; delete current; cout<<"删除成功!";
下一篇:大学生活演讲稿