Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- int main(void) {
- int i, cards[50];
- srand((unsigned) time(NULL));
- for (i = 0; i < 50; i++) cards[i] = i + 1;
- for (i = 49; i >= 1; i--) {
- int t, j = (int) ((rand() / ((double) RAND_MAX + 1.0)) * i);
- t = cards[i]; cards[i] = cards[j]; cards[j] = t;
- }
- for (i = 0; i < 50; i += 5) printf("%d ", cards[i]); puts("");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement