You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.2 KiB

#include<sys.h>
int i, j, n, m;
student f;
student f2;
student in;
student dl;
int main()
{
studentinit(f);
studentinit(f2);
studentinit(in);
studentinit(dl);
LNode* head = (LNode*)malloc(sizeof(LNode));
head->next = NULL;
int choose;
while (1)
{
student_show_menu();
printf("请输入您的选择:");
scanf_s("%d", &choose);
switch (choose)
{
case(1):
student_input(head);//输入信息
break;
case(2):
student_show(head); //显示信息
break;
case(3):
name_find(head, f); //按姓名查找
break;
case(4):
num_find(head, f2); //按学号查找
break;
case(5):
num_seq(head); //按学号排序
break;
case(6):
sum_seq(head); //按总成绩排序
break;
case(7):
stu_insert(head, in); //增加学生
break;
case(8):
stu_del(head, &dl); //删除学生 (对比*、&) 声明函数的时候指针用*代表指针类型,&获取目标地址传递给指针
//在声明中使用*代表取目标地址存储的值。*是指针引用,&是地址引用
break;
case (0)://退出系统
printf("\n退出系统成功\n");
printf("欢迎再次使用【学生信息管理系统】\n\n");
exit(0);
default:
printf("\n您输入的操作有误。请重新输入!\n");
break;
}
}
return 0;
}