p2->sum = temp->sum ;
}
void StudentMassage::Sort() //排序
{
Student *p = NULL , *p1 = NULL , *k = NULL ;
int n = StudentMassage::ListCount() , x , y ;
if(n < 2)
{
cout<<"数据较少,无法排序!"<<endl ;
return ;
}
cout<<"\n\t\t**************************************\n" ;
cout<<"\t\t\t 1、按数学成绩排序"<<endl ;
cout<<"\t\t\t 2、按语文成绩排序"<<endl ;
cout<<"\t\t\t 3、按英语成绩排序"<<endl ;
cout<<"\t\t\t 4、按总分排序" ;
cout<<"\n\t\t**************************************\n\n\t请选择:" ;
cin>>x ;
switch(x)
{
case 1:
{
cout<<"\n\t\t**************************************\n" ;
cout<<"\t\t\t 1、按降序排序\n\t\t\t 2、按升序排序" ;
cout<<"\n\t\t**************************************\n\n\t 请选择:" ;
cin>>y ;
if(y == 1)
{
for(p = Head->next ; p != End ; p = p->next)
for(k = p->next ; k != End ; k = k->next)
{
if(p->math < k->math)
StudentMassage::Swap(p , k) ;
}
cout<<"\n\t\t排序完成!"<<endl ;
StudentMassage::Display() ;
getch() ;
}
else
{
for(p = Head->next ; p != End ; p = p->next)
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库C+课程设计报告学生成绩管理系统(16)在线全文阅读。
相关推荐: