概述
#include<stdio.h>
#define MAX_LEN 100
int main()
{
int i,step,Stu_Sum=0,Fail_Chinese_sum=0,Fail_Math_sum=0,Fail_English_sum=0;
float Score_Chinese[MAX_LEN],Score_Math[MAX_LEN],Score_English[MAX_LEN];
float *Pointer_Chinese,*Pointer_Math,*Pointer_English,Score_Chinese_Sum=0,Score_Math_Sum=0,Score_English_Sum=0;
Pointer_Chinese=Score_Chinese;
Pointer_Math=Score_Math;
Pointer_English=Score_English;
printf(" * * * * * * Student Score System * * * * * * nn");
printf(" * * * * * * Now Please Follow Tip Input * * * * * * nn");
printf("1.Input 1 Logging Student Score .nn");
printf("2.Input 2 Statistics Student Sum Score And Average Score .nn");
printf("3.Input 3 Statistics Fail Student .nn");
printf("4.Input 4 Log Out System .nn");
while(1)
{
printf("Input : ");
scanf("%d",&step);
printf("n");
while(step<1||step>4)
{
printf("Input Error £¬Please Input Again .nn");
scanf("%d",&step);
}
if(step==4) break;
switch(step)
{
case 1:
{
printf("Student Sum £º");
scanf("%d",&Stu_Sum);
printf("n * * * * * * Chinese Score * * * * * * nn");
for(i=0;i<Stu_Sum;i++)
{
scanf("%f",&Score_Chinese[i]);
Score_Chinese_Sum+=*Pointer_Chinese++;
}
printf("n * * * * * * Math Score * * * * * * nn");
for(i=0;i<Stu_Sum;i++)
{
scanf("%f",&Score_Math[i]);
Score_Math_Sum+=*Pointer_Math++;
}
printf("n * * * * * * English Score * * * * * * nn");
for(i=0;i<Stu_Sum;i++)
{
scanf("%f",&Score_English[i]);
Score_English_Sum+=*Pointer_English++;
}
Pointer_Chinese=Score_Chinese;
Pointer_Math=Score_Math;
Pointer_English=Score_English;
}break;
case 2:
{
for(i=0;i<Stu_Sum;i++)
{
printf("Z 0 9 4 1 8 1 0 %d :Sum Score £º%.1f Average Score : %.2fnn",i+1,Pointer_Chinese[i]+Pointer_Math[i]+Pointer_English[i],(Pointer_Chinese[i]+Pointer_Math[i]+Pointer_English[i])/3);
}
}break;
case 3:
{
for(i=0;i<Stu_Sum;i++)
{
if(Score_Chinese[i]<60) Fail_Chinese_sum++;
if(Score_Math[i]<60) Fail_Math_sum++;
if(Score_English[i]<60) Fail_English_sum++;
}
printf("Chinese Fail : %d People !nn",Fail_Chinese_sum);
printf("Math Fail : %d People !nn",Fail_Math_sum);
printf("English Fail : %d People !nn",Fail_English_sum);
}break;
}
printf("n1.Input 1 Logging Student Score .nn");
printf("2.Input 2 Statistics Student Sum Score And Average Score .nn");
printf("3.Input 3 Statistics Fail Student .nn");
printf("4.Input 4 Log Out System .nn");
}
printf(" * * * * * * Well Come You Back Again * * * * * * nn");
}
最后
以上就是柔弱棒球为你收集整理的学生成绩系统C语言指针法实现(包含:统计学生总分、平均分、不及格人数)的全部内容,希望文章能够帮你解决学生成绩系统C语言指针法实现(包含:统计学生总分、平均分、不及格人数)所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复