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