fork download
  1. #include <stdio.h>
  2.  
  3. void yes()
  4. {
  5. puts("congrats with coming out");
  6. }
  7.  
  8. char buf[4] = {};
  9.  
  10. void ask_user();
  11. void ask_user()
  12. {
  13. puts("are you gay?");
  14. void (*procs[])(void) = { &yes, &ask_user };
  15. (*(procs+!!(*((int *)gets(buf)) - 7562617)))();
  16. }
  17.  
  18. int main(int, char **)
  19. {
  20. ask_user();
  21. }
Success #stdin #stdout 0s 2900KB
stdin
no
stop it
okay
yes
stdout
are you gay?
are you gay?
are you gay?
are you gay?
congrats with coming out