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