fork download
  1. /* COPYRIGHT 2015
  2.  * ALL RIGHTS RESERVED!
  3.  * NO COPYING!
  4.  * NONE!
  5.  */
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8.  
  9.  
  10. #define MEDINA(n) \
  11. do { \
  12. int i; \
  13. for (i = 0; i < (n); i++) { \
  14. (rand()%(sizeof funcs / sizeof funcs[0]))[funcs]((n) - 1);\
  15. } \
  16. } while (0);
  17.  
  18. void func001(int n);
  19. void func002(int n);
  20. void func003(int n);
  21. void func004(int n);
  22. void func005(int n);
  23. void func006(int n);
  24. void func007(int n);
  25. void func008(int n);
  26. void func009(int n);
  27.  
  28. typedef void (*funky)(int);
  29.  
  30. funky funcs[] = {
  31. func001,
  32. func002,
  33. func003,
  34. func004,
  35. func005,
  36. func006,
  37. func007,
  38. func008,
  39. func009
  40. };
  41.  
  42. void func001(int n)
  43. {
  44. puts("the");
  45. MEDINA(n);
  46. }
  47. void func002(int n)
  48. {
  49. puts("quick");
  50. MEDINA(n);
  51. }
  52. void func003(int n)
  53. {
  54. puts("brown");
  55. MEDINA(n);
  56. }
  57. void func004(int n)
  58. {
  59. puts("fox");
  60. MEDINA(n);
  61. }
  62. void func005(int n)
  63. {
  64. puts("jumped");
  65. MEDINA(n);
  66. }
  67. void func006(int n)
  68. {
  69. puts("over");
  70. MEDINA(n);
  71. }
  72. void func007(int n)
  73. {
  74. puts("the");
  75. MEDINA(n);
  76. }
  77. void func008(int n)
  78. {
  79. puts("lazy");
  80. MEDINA(n);
  81. }
  82. void func009(int n)
  83. {
  84. puts("dog");
  85. MEDINA(n);
  86. }
  87.  
  88. int main(void)
  89. {
  90. int i;
  91. srand(time(NULL));
  92. for (i = 0; i < 20; i++) {
  93. (rand()%(sizeof funcs / sizeof funcs[0]))[funcs](2);
  94. }
  95. }
  96.  
Runtime error #stdin #stdout 0s 2052KB
stdin
Standard input is empty
stdout
jumped
the
fox
quick
lazy
dog
the
the
dog
jumped
brown
quick
brown
quick
the
lazy
brown
lazy
fox
the
lazy
quick
the
fox
over
jumped
lazy
fox
quick
the
dog
the
quick
brown
over
dog
the
quick
jumped
dog
fox
jumped
lazy
over
fox
jumped
fox
fox
fox
over
the
dog
jumped
lazy
brown
the
the
dog
fox
quick
fox
the
over
jumped
fox
the
brown
quick
dog
the
lazy
brown
dog
the
dog
brown
quick
the
the
brown
fox
the
dog
lazy
brown
the
lazy
the
dog
dog
brown
the
the
over
jumped
quick
over
the
brown
jumped