From 6b02178f284b1fd3e368c8033bd8ebfc89d6a80b Mon Sep 17 00:00:00 2001 From: xuzigui <3542624849@qq.com> Date: Sun, 7 May 2023 21:39:07 +0800 Subject: [PATCH] =?UTF-8?q?XZG=5F=E4=BC=AA=E4=BB=A3=E7=A0=812?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 137 +++++++++++++++++++++++------------------------------- 1 file changed, 59 insertions(+), 78 deletions(-) diff --git a/README.md b/README.md index a7be773..8a29bd7 100644 --- a/README.md +++ b/README.md @@ -829,123 +829,104 @@ end //函数功能:按姓名查找学生成绩并显示查找结果 ``` -void SearchbyName(STU stu[],int n,int m) -{ +function SearchbyName(STU stu[],int n,int m) do char x[MAX_LEN]; int i,j; - printf("Input the name you want to search:"); - scanf("%s", x); - for(i=0;i=0&&stu[i].score[j]<60) t[0]++; - else if(stu[i].score[j]<70) t[1]++; - else if(stu[i].score[j]<80) t[2]++; - else if(stu[i].score[j]<90) t[3]++; - else if(stu[i].score[j]<100) t[4]++; - else if(stu[i].score[j]==100) t[5]++; - } - for(i=0;i<=5;i++) - { - if(i==0) printf("<60\t%d\t%.2f%%\n",t[i],(float)t[i]/n*100); - else if(i==5) printf("%d\t%d\t%.2f%%\n",(i+5)*10,t[i],(float)t[i]/n*100); - else printf("%d-%d\t%d\t%.2f%%\n",(i+5)*10,(i+5)*10+9,t[i],(float)t[i]/n*100); - } - } -} + for from i=0 to n-1 do + if stu[i].score[j]>=0&&stu[i].score[j]<60 set t[0]++ + else if stu[i].score[j]<70 set t[1]++; + else if stu[i].score[j]<80 set t[2]++; + else if stu[i].score[j]<90 set t[3]++; + else if stu[i].score[j]<100 set t[4]++; + else if stu[i].score[j]==100 set t[5]++; + end + for from i=0 to 4 do + if i==0 printf "<60\t%d\t%.2f%%\n" + else if i==5 printf "%d\t%d\t%.2f%%\n" + else printf "%d-%d\t%d\t%.2f%%\n" + end + end +end ``` //函数功能:打印学生成绩 ``` -void PrintScore(STU stu[],int n,int m) -{ +function PrintScore(STU stu[],int n,int m) do int i,j; - for (i=0; i