文档介绍:#include <>
#include <>
#include <>
#include <>
struct student //结构体定义
{
int num;
char name[10];
char birthday[10];
int Cyuyan;
int shujujiegou;
struct student *next;
};
struct student *creat_by_input();
struct student *get_last_student(struct student *head);
struct student *Print_menu_main() //主菜单
{
printf(" *********************************************************************\n");
printf(" | 1.........输入学生信息| \n");
printf(" | 2.........输出学生信息| \n");
printf(" | 3.........查找学生信息| \n");
printf(" | 4.........修改学生信息| \n");
printf(" | 5.........插入学生信息| \n");
printf(" | 6.........删除学生信息| \n");
printf(" | 7.........排序学生信息| \n");
printf(" | 0.........退出系统| \n");
printf(" |_ _ _ _ _ _ _ _ _ _ _ _ _ | \n");
}
struct student *print_table_head()
{
printf("+----------+----------+----------+----------+-------------+\n");
printf("| 学号| 姓名| 出生日期| c成绩|数据结构成绩|\n");
printf("+----------+----------+----------+----------+-------------+\n");
}
struct student *print_table_row(struct student *p)
{
printf("|%10d|%10s|%10s|%10d|%10d|\n",p->num,p->name,p->birthday,p->Cyuyan,p->shujujiegou);
}
void print_table_bottom()
{
printf("+----------+----------+----------+----------+-------------+\n");
}
struct student * Creat_stu_record() //建立链表
{
struct student *plaststu=NULL,*pnewstu;
char continue_input='N';
struct student *head=NULL;
while(1)
{
if(head==NULL)
{
head=creat_by_input();
print_table_head();
print_table_row(head);
print_table_bottom();
}
else
{
pnewstu=creat_by_input();
print_table_head();
print_table_row(pnewstu);
print_table_bottom();
plaststu=get_last_student(head);
plaststu->next=pnewstu;}
printf("是否继续输入学生信息?(Y 继续,N 返回菜单)\n");
getchar();
continue_input=getchar();
if(continue_input=='n'||continue_input=='N')
{
system("cls");
Print_menu_main();
break;
}
}
return head;
}
struct student *creat_by_inp