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()%10+1;
  11. switch(a){
  12. case 1:
  13. printf("大吉");
  14. break;
  15. case 2:
  16. printf("中吉");
  17. break;
  18. case 3:
  19. printf("小吉");
  20. break;
  21. case 4:
  22. case 5:
  23. case 6:
  24. case 7:
  25. case 8:
  26. case 9:
  27. case 10:
  28. printf("吉");
  29. break;
  30. }
  31. return 0;
  32. }
  33.  
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
大吉