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