From cf25fa56c9e8872f687123edb8ddaee724a00c4a Mon Sep 17 00:00:00 2001 From: xuzilin <2849252603@qq.com> Date: Tue, 25 Apr 2023 16:50:55 +0800 Subject: [PATCH] XZL_StatisticAnalysis --- README.md | 5 + StatisticAnalysis.svg | 385 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 390 insertions(+) create mode 100644 StatisticAnalysis.svg diff --git a/README.md b/README.md index 8e54b0a..36cfca3 100644 --- a/README.md +++ b/README.md @@ -453,6 +453,11 @@ Step 2:利用 if 条件和循环判断是否有此学生并显示结果 ![按姓名查找学生成绩并显示查找结果](SearchbyName.svg) #### StatisticAnalysis +Step 1:将数组 t 的全部元素初始化为0 +Step 2:利用循环和if条件统计各分数段学生人数 +Step 3:利用循环和if条件统计各分数段学生所占比结果 + +![统计各分数段的学生人数及所占的百分比](StatisticAnalysis.svg) #### PrintScore #### WritetoFile diff --git a/StatisticAnalysis.svg b/StatisticAnalysis.svg new file mode 100644 index 0000000..78c7a57 --- /dev/null +++ b/StatisticAnalysis.svg @@ -0,0 +1,385 @@ + + + + + + + + + + + + + + StatisticAnalysis + (Integer n, Integer m) + + + + + + End + + + + + + + + + + + + + + + Integer i + + + + + + + + Integer j + + + + + + + + Integer t[6] + + + + + + + + + + + + + + + + + + Output For course %d:\n + + + + + + + + memset(t, 0, sizeof(t)) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + stu[i].score[j] >= 0 && stu[i]. + score[j] < 60 + + + + + + t[0] = t[0]+1 + + + + + + + True + + + False + + + + + + + + + + + + + stu[i].score[j] < 70 + + + + + + t[1] = t[1]+1 + + + + + + + True + + + False + + + + + + + + + + + + + stu[i].score[j] < 80 + + + + + + t[2] = t[2]+1 + + + + + + + True + + + False + + + + + + + + + + + + + stu[i].score[j] < 90 + + + + + + t[3] = t[3]+1 + + + + + + + True + + + False + + + + + + + + + + + + + stu[i].score[j] < 100 + + + + + + t[4] = t[4]+1 + + + + + + + True + + + False + + + + + + + + + + + + + stu[i].score[j] == 100 + + + + + + t[5] = t[5]+1 + + + + + + + True + + + False + + + + + + + i = 0 to n-1 + + + + Next + + + Done + + + + + + + + + + + + + + + + + + + + i == 0 + + + + + + Output <60\t%d\t%.2f%%\n + + + + + + + + + + + + + + + i==5 + + + + + + Output %d\t%d\t%.2f%%\n + + + + + + Output %d-%d\t%d\t%.2f + %%\n + + + + + True + + + False + + + + + True + + + False + + + + + + i = 0 to 5 + + + + Next + + + Done + + + + + + + j = 0 to m-1 + + + + Next + + + Done + + + + +