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