parent
1333bea8dd
commit
050a2a3c07
@ -0,0 +1,31 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
Loading…
Reference in new issue