init
This commit is contained in:
29
c/switch.c
Normal file
29
c/switch.c
Normal file
@@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
|
||||
enum options {
|
||||
STOP = 'q',
|
||||
CONTINUE = 'c',
|
||||
NEW = 'n',
|
||||
};
|
||||
|
||||
|
||||
|
||||
int main() {
|
||||
char optbuff[4];
|
||||
|
||||
while (optbuff[0] != STOP) {
|
||||
printf("choose sumth");
|
||||
scanf("%4s", optbuff);
|
||||
|
||||
switch (optbuff[0]) {
|
||||
case STOP:
|
||||
printf("stop\n");
|
||||
break;
|
||||
case CONTINUE:
|
||||
printf("continue\n");
|
||||
break;
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user