fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int opt;
  7. scanf("%d",&opt);
  8. while(1)
  9. {
  10. switch(opt)
  11. {
  12. case 1:printf("1");
  13. break;
  14. case 2:printf("2");
  15. break;
  16. case 3:exit(0);
  17. }
  18.  
  19. printf("\n");
  20. scanf("%d",&opt);
  21. }
  22.  
  23. return 0;
  24.  
  25. }
Success #stdin #stdout 0s 2296KB
stdin
1
2
3
stdout
1
2