From 5f38e8efd531490c07b0d9a737f6a334cea8aefb Mon Sep 17 00:00:00 2001 From: xuzilin <2849252603@qq.com> Date: Tue, 25 Apr 2023 16:05:38 +0800 Subject: [PATCH] SearchbyNum --- README.md | 6 ++ SearchbyNum.svg | 195 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 201 insertions(+) create mode 100644 SearchbyNum.svg diff --git a/README.md b/README.md index 41341ba..62848ae 100644 --- a/README.md +++ b/README.md @@ -439,6 +439,12 @@ Step 4:将结果按照舒徐,总分和平均分的顺序进行输出 #### SearchbyNum +Step 1:利用for循环给 i 赋值为 0 +Step 2:利用 if 条件判断学号是否一致 +Step 3:利用二次循环找出所有符合条件的学生 +Step 4:利用if条件语句能否找到该学生 + +![按学号查找学生成绩并显示查找结果](SearchbyNum.svg) #### SearchbyName #### StatisticAnalysis diff --git a/SearchbyNum.svg b/SearchbyNum.svg new file mode 100644 index 0000000..617883a --- /dev/null +++ b/SearchbyNum.svg @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + SearchbyNum + (Integer n, Integer m) + + + + + + End + + + + + + + + + + + + + + + + + + + + + Integer number + + + + + + + + Integer i + + + + + + + + Integer j + + + + + + Output Input the number + you want to search: + + + + + + Input %ld + + + + + + + + + + + + + + + + + + stu[i].num == number + + + + + + + + + + + + Output \n + + + + + + + + + + + Output %d\t + + + + + + j = 0 to m-1 + + + + Next + + + Done + + + + + + Output \n + + + + + + Break + + + + + + + + True + + + False + + + + + + i = 0 to n-1 + + + + Next + + + Done + + + + + + + + + + + + + i == n + + + + + + Output \nNot found!\n + + + + + + + True + + + False + + + + +