学生成绩管理系统V4.0
学生成绩管理系统软件主要适用于成绩管理!这款软件具有成绩输入、各班成绩汇总分析、成绩打印、成绩综合排名等一系列功能。这款软件完全根据学校平常的学生成绩管理办法研发出来。运用先进的语言VC++研发而成,因此适用性很强的哦!
经过下载测试,金顶峰学生成绩管理系统是一个不错的学生成绩管理软件,支持EXCEL输出功能。能做到全年级成绩排行。这款软件分学校用模块和上级部门汇总模块。
#include 《stdio.h》
#include 《stdlib.h》
#define N 30
#define M 6
void Input (long num[],int score[][M],int n,int m);
void Totalave (int score[][M],int n,int m);
void evestuTotalave (int score[][M],int n,int m,long num[]);
void Scoredes (long num[],int score[][M],int n,int m);
void Scoreas (long num[],int score[][M],int n,int m);
void Numas (long num[],int score[][M],int n,int m);
void Search (long num[],int score[][M],int n,int x,int m);
void staTIsTIs (long num[],int score[][M],int n,int m);
void List (long num[],int score[][M],int n,int m);
int main()
{
int n,score[N][M],c,x,m;
long num[N];
printf(“输入学生人数”);
scanf(“%d”,&n);
printf(“输入考试科目”);
scanf(“%d”,&m);
printf(“1.Input record\n”);
printf(“2.Caculate totel and average score of every course\n”);
printf(“3.Caculate totel and average score of every student\n”);
printf(“4.Sort in descending order by total score of every student\n”);
printf(“5.Sort in ascending order by total score of every student\n”);
printf(“6.Sort in ascending order by number\n”);
printf(“7.Search by number\n”);
printf(“8.StaTIsTIc analysis for every course\n”);
printf(“9.List record\n”);
printf(“0.Exit\n”);
printf(“Please enter your choice:\n”);
printf(“\n”); for(;;)
{
scanf(“%d”,&c); switch(c)
{
case 1: //录入学生学号和各科成绩
Input (num,score,n,m);
printf(“Please enter your choice:\n”);
break;
case 2: //计算每门课程的总分和平均分
Totalave (score,n,m);
printf(“Please enter your choice:\n”);
break;
case 3: //计算每个学生的总分和平均分
evestuTotalave (score,n,m,num);
break;
case 4: //按每个学生的总分由高到低排出名次表
Scoredes (num,score,n,m);
printf(“Please enter your choice:\n”);
break;
case 5: //按每个学生的总分由低到高排出名次表
Scoreas (num,score,n,m);
printf(“Please enter your choice:\n”);
break;
case 6: //按学号由小到大排出名次表
Numas (num,score,n,m);
printf(“Please enter your choice:\n”);
break;
case 7: //按学号查询学生排名及其各科成绩
printf(“请输入查找学号\n”);
scanf(“%d”,&x);
Search (num,score,n,x,m);
printf(“Please enter your choice:\n”);
break;
case 8: //成绩分析 所占百分比 statistis (num,score,n,m);
printf(“Please enter your choice:\n”);
break;
case 9: //全部输出
List (num,score,n,m);
Totalave (score,n,m);
printf(“Please enter your choice:\n”);
break;
case 0:
exit(0);
}
}
return 0;
}
void Input (long num[],int score[][M],int n,int m) //1
{
int i,j;
for(i=0;i
{
printf(“Input student‘s ID and score”);
scanf(“%ld”,&num[i]);
for(j=0;j《m;j++)
scanf(“%d”,&score[i][j]);
}
}
void Totalave (int score[][M],int n,int m) //2.计算每门课程的总分和平均分
{
int i,j,sum[M];
double ave[M];
for(j=0;j《m;j++)
{
sum[j]=0;
for(i=0;i《n;i++)
{
sum[j]=sum[j]+score[i][j];
}
ave[j]=(double)sum[j]/n;
}
for(i=0;i《m;i++)
printf(“科目%d的总分=%d,课程的平均分=%f\n”,i+1,sum[i],ave[i]);
}
void evestuTotalave (int score[][M],int n,int m,long num[]) //3.计算每个学生的总分和平均分 {
int i,j,sum[N];
double ave[N];
for(i=0;i《n;i++)
{
sum[i]=0;
for(j=0;j《m;j++)
{
sum[i]=sum[i]+score[i][j];
}
ave[i]=(double)sum[i]/m;
}
for(i=0;i《n;i++)
printf(“学号为%ld的总分=%d,其平均分=%f\n”,num[i],sum[i],ave[i]);
}
void Scoredes (long num[],int score[][M],int n,int m) //4.按每个学生的总分由高到低排出名次表
{
int i,j,k,t,h,sum[N];
for(i=0;i
{
sum[i]=0;
for(j=0;j
{
sum[i]=sum[i]+score[i][j];
}
}
for(i=0;i
{
k=i;
for(j=i+1;j
{
if (sum[j]>sum[k]) k=j;
}
if(i!=k)
{
t=sum[k],h=num[k];
sum[k]=sum[i],num[k]=num[i];
sum[i]=t,num[i]=h;
}
}
for(i=0;i
printf("ID:%10ld,score:%d\n",num[i],sum[i]);//以长整形打印用%ld }
void Scoreas (long num[],int score[][M],int n,int m) //5.按每个学生的总分由di到gao排出名次表 {
int i,j,k,t,h,sum[N];
for(i=0;i
{
sum[i]=0;
for(j=0;j
{
sum[i]=sum[i]+score[i][j];
}
}
for(i=0;i
{
k=i;
for(j=i+1;j
{
if (sum[j]
k=j;
}
if(i!=k)
{
t=sum[k],h=num[k];
sum[k]=sum[i],num[k]=num[i];
sum[i]=t,num[i]=h;
}
}
for(i=0;i
printf("ID:%10ld,score:%d\n",num[i],sum[i]);//以长整形打印用%ld }
void Numas (long num[],int score[][M],int n,int m) //6.按学号由小到大排出名次表 {
int i,j,k,t[M],h,l;
for(i=0;i
{
k=i;
for(j=i+1;j
{
if (num[j]
}
if(i!=k)
{
h=num[k];
num[k]=num[i];
num[i]=h;
for(l=0;l
{
t[l]=score[k][l];
score[k][l]=score[i][l];
score[i][l]=t[l];
}
}
}
for(i=0;i
{
printf("ID:%10ld\n",num[i]);//以长整形打印用%ld for(j=0;j
printf("project %d score:%d\n",j+1,score[i][j]);
}
}
void Search (long num[],int score[][M],int n,int x,int m) //7.按学号查询学生排名及其各科成绩
{
int high=n-1,low=0,mid,c=1,pos,o,find=0,i,j,k,t[M],h,sum[N],l; for(i=0;i
{
sum[i]=0;
for(j=0;j
{
sum[i]=sum[i]+score[i][j];
}
}
for(i=0;i
{
k=i;
for(j=i+1;j
{
if (num[j]
}
if(i!=k)
{
h=num[k],o=sum[k];
num[k]=num[i],sum[k]=sum[i];
num[i]=h,sum[i]=o;
for(l=0;l
{
t[l]=score[k][l];
score[k][l]=score[i][l];
score[i][l]=t[l];
}
}
}
while(find==0&&low<=high)
{
mid=(high+low)/2;
if(x>num[mid]) low=mid+1;
else if(x
else
{
pos=mid;
find=1;
}
}
if(find==0)
printf("not find\n"); else
{
for(i=0;i
{
if(sum[i]>sum[pos]) c++;
}
printf("ID:%10ld\n",num[pos]);//以长整形打印用%ld for(j=0;j
printf("project %d score:%d\n",j+1,score[pos][j]);
printf("all score: %d,order:%d\n",sum[pos],c);
}
}
void statistis (long num[],int score[][M],int n,int m) //8. {
int a=0,b=0,c=0,d=0,e=0,i,j;
double A,B,C,D,E;
for(j=0;j
{
for(i=0;i
{
if(score[i][j]>=90) a++;
else if(score[i][j]>=80) b++;
else if(score[i][j]>=70) c++;
else if(score[i][j]>=60) d++; else e++; }
A=(double)a/n*100;
B=(double)b/n*100;
C=(double)c/n*100;
D=(double)d/n*100;
E=(double)e/n*100;
printf("project %d\n",j+1);
printf("优秀人数%d,百分比:%f%%\n",a,A);
printf("良好人数%d,百分比:%f%%\n",b,B);
printf("中等人数%d,百分比:%f%%\n",c,C);
printf("及格人数%d,百分比:%f%%\n",d,D);
printf("不及格人数%d,百分比:%f%%\n",e,E);
}
}
void List (long num[],int score[][M],int n,int m) {
int i,j,sum[N];
double ave[N];
for(i=0;i
{
sum[i]=0;
for(j=0;j
{
sum[i]=sum[i]+score[i][j];
}
ave[i]=(double)sum[i]/m;
}
for(i=0;i
{
printf("ID:%10ld\n",num[i]);
for(j=0;j
{
printf("score:%d\n",score[i][j]);
}
printf("总分=%d\n平均分%f\n",sum[i],ave[i]);
}
}