用链表处理学号成绩(参考程序).docVIP

  • 2
  • 0
  • 约5.37千字
  • 约 6页
  • 2017-10-18 发布于天津
  • 举报
用链表处理学号成绩(参考程序).doc

//用链表处理学号成绩 #includeiostream.h struct student //定义结构体 { long num; int score; student *next; }; student *creat(); //建立链表 void print(student *head); //输出链表 student *insert(student *head,student *stud);//插入节点 student *del(student *head,long num);//删除节点 void main() { student *head=NULL,*stud; long num;int score; cout 建立学号、成绩:endl; head=creat(); cout建立成绩链表后的学号、成绩endl; print(head); cout输入插入的学号(0或负数结束):;cinnum; while(num0) { cout成绩:;cinscore; stud=new student; stud-num=num; stud-score=score; head=insert(head,stud); cout输入插入的学号(0或负数结束):;cin

文档评论(0)

1亿VIP精品文档

相关文档