From 35dc9f948a0043832cd6bbc6df211f5e1ee61c95 Mon Sep 17 00:00:00 2001 From: pfwail38f <1044591285@qq.com> Date: Sun, 12 Nov 2023 22:50:26 +0800 Subject: [PATCH] ADD file via upload --- 1.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 1.c diff --git a/1.c b/1.c new file mode 100644 index 0000000..94445d8 --- /dev/null +++ b/1.c @@ -0,0 +1,43 @@ +#include + +void displayMenu() { + printf(" 1. Input\n"); + printf(" 2. Output\n"); + printf(" 3. Order\n"); + printf(" 4. Quit\n"); +} + +char getUserChoice() { + char choice; + scanf(" %c", &choice); + return choice; +} + +int main() { + char userChoice; + + while (1) { + displayMenu(); + userChoice = getUserChoice(); + + switch (userChoice) { + case 'i': + printf("You are trying to Input info\n"); + break; + case 'o': + printf("You are trying to Output info\n"); + break; + case 'm': + printf("You are trying to Make things ordered\n"); + break; + case 'q': + printf("You are about to Quit\n"); + return 0; + default: + printf("Wrong input\n"); + break; + } + } + + return 0; +} \ No newline at end of file