studentlist.h
来自「用C++编写的教师学生相关信息和统计系统」· C头文件 代码 · 共 49 行
H
49 行
#include "common_student.h"
#ifndef student_h
#define student_h
class student
{
common_student *root;
public:
student()
{root=NULL;}
void orderinsert(common_student *s);
void orderprintlist();
};
//
void student::orderinsert(common_student *s)
{
float key;
key=s->maths;
common_student *curr=root;
common_student *prey=NULL;
while(curr!=NULL&&key>curr->maths)
{
prey=curr;
curr=curr->next;
}
s->getnode();
s->ptr->next=curr;
if(prey==NULL)
root=s->ptr;
else
prey->next=s->ptr;
}
//
void student::orderprintlist()
{
common_stuent *current=root;
while(current!=NULL)
{
current->print();
cout<<"-----------------------------"<<endl;
current=current->next;
}
}
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?