学生成绩管理系统(C语言)

这是一个使用C语言编写的学生成绩管理系统,包括初始化、输入、输出、查找、排序和插入功能。系统通过链表结构存储学生信息,支持按姓名和平均分进行操作。
摘要由CSDN通过智能技术生成

#include<stdio.h>
#include<malloc.h>
#include<string.h>
typedef struct Student
{
 int no;
 char name[10];
 float score[3];  //three scores
 float average;  //average score
 struct Student *next;
}Student;

void Initial(Student *p)
{
 p=(Student*)malloc(sizeof(Student));//the head of the linklist
 p->next=NULL;
}
void Input(Student *p)
{
 Student *stu=(Student*)malloc(sizeof(Student));
 printf("学号:"); scanf("%d",&stu->no);
 printf("姓名:"); scanf("%s",stu->name);
 printf("成绩1:"); scanf("%f",&stu->score[0]);
 printf("成绩2:"); scanf("%f",&stu->score[1]);
 printf("成绩3:"); scanf("%f",&stu->score[2]);
 stu->average=(stu->score[0]+stu->score[1]+stu->score[2])/3;
 stu->next=NULL;
 Student *ps=(Student*)malloc(sizeof(Student));
 ps=p;
 while(ps->next)
  ps=ps->next;
 ps->next=stu;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值