fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(void)
  5. {
  6. const char *array[6] =
  7. {
  8. "alpha", "bravo", "charlie", "delta", "echo", "foxtrot"
  9. };
  10.  
  11. for (int i = 0; i < 6; i++)
  12. {
  13. puts(array[i]);
  14. if (i > 0) {
  15. int back = rand() % 3;
  16. i -= back;
  17. }
  18. }
  19. }
  20.  
Success #stdin #stdout 0s 2160KB
stdin
Standard input is empty
stdout
alpha
bravo
bravo
bravo
charlie
charlie
bravo
bravo
bravo
charlie
delta
delta
charlie
charlie
bravo
bravo
alpha
bravo
bravo
charlie
delta
delta
delta
charlie
bravo
charlie
delta
charlie
bravo
alpha
bravo
bravo
bravo
bravo
alpha
bravo
charlie
delta
echo
delta
echo
echo
echo
echo
echo
foxtrot