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