c语言环境下的学生成绩管理系统
时间: 2024-01-03 21:21:37 浏览: 32
学生成绩管理系统是一个常见的应用程序,它可以帮助学校或教育机构管理学生的成绩信息。在C语言环境下,可以使用链表来实现学生成绩管理系统。以下是该系统的几个功能的实现方法:
1.添加学生信息
```c
void add(LinkList llist){
LinkList p=llist;
while(p->next!=NULL) p=p->next;
LinkList newnode=(LinkList)malloc(sizeof(Node));
printf("请输入学号:\n");
scanf("%d",&newnode->stdio);
printf("请输入姓名:\n");
scanf("%s",newnode->name);
printf("请输入语文成绩:\n");
scanf("%lf",&newnode->chinese);
printf("请输入数学成绩:\n");
scanf("%lf",&newnode->math);
printf("请输入英语成绩:\n");
scanf("%lf",&newnode->english);
printf("请输入政治成绩:\n");
scanf("%lf",&newnode->politics);
newnode->sum=newnode->chinese+newnode->math+newnode->english+newnode->politics;
newnode->next=NULL;
p->next=newnode;
}
```
2.删除学生信息
```c
void del(LinkList llist){
LinkList p=llist->next,q=llist;
int f;
printf("请输入要删除的学号:\n");
scanf("%d",&f);
while(p!=NULL){
if(p->stdio==f){
q->next=p->next;
free(p);
printf("删除成功!\n");
return;
}
q=p;
p=p->next;
}
printf("查无此人!\n");
}
```
3.查找学生信息
```c
void check(LinkList llist){
LinkList e=llist->next;
int f;
printf("请输入查找的学号:\n");
scanf("%d",&f);
while(e->stdio!=f) e=e->next;
if(e->stdio==f)
printf("%d\t %s%12lf %6lf %6lf %6lf %6lf\n",e->stdio,e->name,e->chinese,e->math,e->english,e->politics,e->sum);
else
printf("查找值不存在!\n");
}
```
4.修改学生信息
```c
void modify(LinkList llist){
LinkList p=llist->next;
int f;
printf("请输入要修改的学号:\n");
scanf("%d",&f);
while(p!=NULL){
if(p->stdio==f){
printf("请输入新的姓名:\n");
scanf("%s",p->name);
printf("请输入新的语文成绩:\n");
scanf("%lf",&p->chinese);
printf("请输入新的数学成绩:\n");
scanf("%lf",&p->math);
printf("请输入新的英语成绩:\n");
scanf("%lf",&p->english);
printf("请输入新的政治成绩:\n");
scanf("%lf",&p->politics);
p->sum=p->chinese+p->math+p->english+p->politics;
printf("修改成功!\n");
return;
}
p=p->next;
}
printf("查无此人!\n");
}
```
相关推荐
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)