fork(2) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int
  5. main(void)
  6. {
  7. for (int i = 1; i <= 72; ++i) {
  8. int flat=i,adoc=9*4, dock=flat/adoc+1,level=(flat-(dock-1)*adoc)/4;
  9. printf("flat %d Dock %d Level %d\n",flat,dock,level);
  10. }
  11. return 0;
  12. }
Success #stdin #stdout 0.01s 1676KB
stdin
Standard input is empty
stdout
flat 1 Dock 1 Level 0
flat 2 Dock 1 Level 0
flat 3 Dock 1 Level 0
flat 4 Dock 1 Level 1
flat 5 Dock 1 Level 1
flat 6 Dock 1 Level 1
flat 7 Dock 1 Level 1
flat 8 Dock 1 Level 2
flat 9 Dock 1 Level 2
flat 10 Dock 1 Level 2
flat 11 Dock 1 Level 2
flat 12 Dock 1 Level 3
flat 13 Dock 1 Level 3
flat 14 Dock 1 Level 3
flat 15 Dock 1 Level 3
flat 16 Dock 1 Level 4
flat 17 Dock 1 Level 4
flat 18 Dock 1 Level 4
flat 19 Dock 1 Level 4
flat 20 Dock 1 Level 5
flat 21 Dock 1 Level 5
flat 22 Dock 1 Level 5
flat 23 Dock 1 Level 5
flat 24 Dock 1 Level 6
flat 25 Dock 1 Level 6
flat 26 Dock 1 Level 6
flat 27 Dock 1 Level 6
flat 28 Dock 1 Level 7
flat 29 Dock 1 Level 7
flat 30 Dock 1 Level 7
flat 31 Dock 1 Level 7
flat 32 Dock 1 Level 8
flat 33 Dock 1 Level 8
flat 34 Dock 1 Level 8
flat 35 Dock 1 Level 8
flat 36 Dock 2 Level 0
flat 37 Dock 2 Level 0
flat 38 Dock 2 Level 0
flat 39 Dock 2 Level 0
flat 40 Dock 2 Level 1
flat 41 Dock 2 Level 1
flat 42 Dock 2 Level 1
flat 43 Dock 2 Level 1
flat 44 Dock 2 Level 2
flat 45 Dock 2 Level 2
flat 46 Dock 2 Level 2
flat 47 Dock 2 Level 2
flat 48 Dock 2 Level 3
flat 49 Dock 2 Level 3
flat 50 Dock 2 Level 3
flat 51 Dock 2 Level 3
flat 52 Dock 2 Level 4
flat 53 Dock 2 Level 4
flat 54 Dock 2 Level 4
flat 55 Dock 2 Level 4
flat 56 Dock 2 Level 5
flat 57 Dock 2 Level 5
flat 58 Dock 2 Level 5
flat 59 Dock 2 Level 5
flat 60 Dock 2 Level 6
flat 61 Dock 2 Level 6
flat 62 Dock 2 Level 6
flat 63 Dock 2 Level 6
flat 64 Dock 2 Level 7
flat 65 Dock 2 Level 7
flat 66 Dock 2 Level 7
flat 67 Dock 2 Level 7
flat 68 Dock 2 Level 8
flat 69 Dock 2 Level 8
flat 70 Dock 2 Level 8
flat 71 Dock 2 Level 8
flat 72 Dock 3 Level 0