fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. int main(void)
  6. {
  7. int i = 0;
  8. int point[7] = {0,};
  9. int randomNumber = 0;
  10. srand((unsigned)time(NULL));
  11. for (i = 0; i < 7; i++)
  12. {
  13. randomNumber = rand()%6;
  14. point[i] = randomNumber;
  15. }
  16. printf("면 빈도\n");
  17. for (i = 1; i < 7; i++)
  18. {
  19. printf("%d %d\n", i, point[i]);
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0s 4336KB
stdin
Standard input is empty
stdout
면      빈도
1      0
2      0
3      0
4      1
5      0
6      3