fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. int main(void) {
  6. int rsp;
  7. srand((unsigned)time(NULL));
  8. rsp = rand()%10;
  9. switch(rsp){
  10. case 1:
  11. case 2:
  12. printf("グー");
  13. break;
  14.  
  15. case 3:
  16. case 4:
  17. case 5:
  18. printf("チョキ");
  19. break;
  20. default :
  21. printf("パー");
  22. break;
  23.  
  24. }
  25.  
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
グー