C语言程序设计:学生成绩管理系统

来源:百度知道 编辑:UC知道 时间:2024/05/22 14:27:44
内容:有10 个学生,4门课程,可以求全班的单课平均成绩和某个人的多门平均成绩.
要求:有输入,删除,修改,排序,显示,查询数据等功能。至少用到结构体和数组。
拜托个位高手了,下星期之前就要交了,谢谢了

这是我今天刚考完的,5个学生 3门课程,和你的差不多,你只要稍微修改一下就可以啦~
记得给分我啊!~~~~~~~~~~~~~~~~~~

#include "stdio.h"
#include "stdlib.h"
#define N 5
void sort(char *code[],char *name[],float *scorel,float *score2,float *score3,float *aver,int n);
main()
{char *code[N],*name[N];
float score1[N],score2[N],score3[N],aver[N];
int i;
for (i=0;i<N;i++)
{printf("input NO.%d:",i+1);
code[i]=malloc(8);
name[i]=malloc(12);
scanf("%s%s%f%f%f",code[i],name[i],&score1[i],&score2[i],&score3[i]);
aver[i]=(score1[i]+score2[i]+score3[i])/3.0;
}
printf("\n");
printf(" school report(1) \n");
printf("------------------------------------------------------------- \n");
printf("code name score1 score2 score3 aver\n");
printf("-------------------------------------------------