diff --git a/README.md b/README.md index 97c2f85..4ff7eb8 100644 --- a/README.md +++ b/README.md @@ -453,6 +453,10 @@ Step 4:利用if条件语句能否找到该学生 ![按学号查找学生成绩并显示查找结果](SearchbyNum.svg) #### SearchbyName +Step 1:利用for循环给 i 赋值为 0 +Step 2:利用 if 条件和循环判断是否有此学生并显示结果 + +![按姓名查找学生成绩并显示查找结果](SearchbyName.svg) #### StatisticAnalysis #### PrintScore diff --git a/SearchbyName.svg b/SearchbyName.svg new file mode 100644 index 0000000..4af71d6 --- /dev/null +++ b/SearchbyName.svg @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + SearchbyName + (Integer n, Integer m) + + + + + + Return Integer + + + + + + + + + + + + + + + + + + + + + String x[MAX_LEN] + + + + + + + + Integer i + + + + + + + + Integer j + + + + + + Output Input the name you + want to search: + + + + + + Input %s + + + + + + + + + + + + + + + + + + strcmp(stu[i].name, x) == 0 + + + + + + + + + + + Output %ld\t%s\t + + + + + + + + + + + Output %.0f\t + + + + + + j = 0 to m-1 + + + + Next + + + Done + + + + + + Output .0f\t%.0f\n + + + + + + + + True + + + False + + + + + + i = 0 to n-1 + + + + Next + + + Done + + + + + + Output \nNot found!\n + + + + +