From 050a2a3c0723d8ae2a8c629940d07c80db8a91b4 Mon Sep 17 00:00:00 2001 From: ptslgaequ <2728416244@qq.com> Date: Sat, 16 Nov 2024 10:40:00 +0800 Subject: [PATCH] ADD file via upload --- 学籍管理系统1.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 学籍管理系统1.cpp diff --git a/学籍管理系统1.cpp b/学籍管理系统1.cpp new file mode 100644 index 0000000..be90d51 --- /dev/null +++ b/学籍管理系统1.cpp @@ -0,0 +1,31 @@ +#include +#include +#include +#include + +int main() { + char choice[10]; + printf(" 1.Input\n"); + printf(" 2.Output\n"); + printf(" 3.Order\n"); + printf(" 4.Quit\n"); + scanf("%s", choice); + // 将输入的字符转换为小写字母,方便后续判断 + for (int i = 0; i < strlen(choice); i++) { + choice[i] = tolower(choice[i]); + } + + if (strcmp(choice, "i") == 0) { + printf("You are trying to Input info\n"); + } else if (strcmp(choice, "o") == 0) { + printf("You are trying to Output info\n"); + } else if (strcmp(choice, "m") == 0) { + printf("You are trying to Make things ordered\n"); + } else if (strcmp(choice, "q") == 0) { + printf("You are about to Quit\n"); + } else { + printf("Wrong input\n"); + } + + return 0; +} \ No newline at end of file