1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 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; } }