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