📄 studentlist.h
字号:
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -