From 9dbf9cf3f543280e74c0f483d0e6643a4a664d37 Mon Sep 17 00:00:00 2001 From: tong tong zhang Date: Sat, 22 Apr 2023 15:03:46 +0800 Subject: [PATCH] ztt1 --- README.md | 66 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 51 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index d589325..fabe634 100644 --- a/README.md +++ b/README.md @@ -121,16 +121,13 @@ void ReadScore(STU stu[], int n, int m) { int i, j; printf("Input student's ID, name and score:\n"); - /* ---------- begain ---------- */ for(i=0;i b; - } +} +// 7交换两个单精度浮点型数据 + +// 8交换两个长整型数据 + // 9交换两个字符串 void SwapChar(char x[], char y[]) { @@ -165,7 +169,9 @@ strcpy(temp, x); strcpy(x, y); strcpy(y, temp); } -//10 +// 10函数功能:按选择法将数组num的元素值按从低到高排序 + +// 11函数功能:交换法实现字符串按字典顺序排序 void AsSortbyNum(STU stu[], int n, int m) { int i, j, k, t; @@ -189,21 +195,32 @@ SwapChar(stu[k].name, stu[i].name); } } } -// 15函数功能: 打印学生成绩 -void PrintScore(STU stu[], int n, int m) +// 12函数功能:按学号查找学生成绩并显示查找结果 + +// 13函数功能:按姓名的字典顺序排出成绩表 +void SearchbyName(STU stu[], int n, int m) { - int i, j; + char x[MAX_LEN]; + int i, j; + printf("Input the name you want to search:"); + scanf("%s", x); for (i=0; i