我是靠谱客的博主 柔弱棒球,这篇文章主要介绍学生成绩系统C语言指针法实现(包含:统计学生总分、平均分、不及格人数),现在分享给大家,希望可以做个参考。

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#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语言指针法实现(包含内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(60)

评论列表共有 0 条评论

立即
投稿
返回
顶部