[ create a new paste ] login | about

Link: http://codepad.org/fwE5wGhx    [ raw code | output | fork ]

C, pasted on Dec 16:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
int main (int argc, char **argv) {
  int players = 6;
  char* cards = "01234501234501234578";
  int ncards = strlen(cards);

  int i, j;
  for (i = 0; i < players; i++) {
    for (j = i; j < (ncards - (ncards % players)); j += players) {
      putc(cards[j], stdout);
    }
    printf("\n");
  }
  return 0;
}


Output:
1
2
3
4
5
6
000
111
222
333
444
555


Create a new paste based on this one


Comments: