#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void shuffle(int [ ][13]);
void print_trump(int [ ][13], int*, int*);
int deck[4][13]={{},{}};
int trump_mark[4]={100,200,300,400};
int trump_num[13]={1,2,3,4,5,6,7,8,9,10,11,12,13};
int main(void){
shuffle(deck);
print_trump(deck,trump_mark,trump_num);
return 0;
}
void shuffle(int deck[][13]){
int r, c, num;
for(num = 1; num <= 52; num++){
do{
}while(deck[r][c] != 0);
deck[r][c] = num;
}
}
void print_trump(int deck[4][13], int*s, int*t){
int r, c, num;
for(num=1; num <= 52; num++){
for(r = 0; r < 4; r++){
for(c = 0; c < 13; c++){
if(deck[r][c] == num){
printf("%2d:%d-%d\n", num
, s
[r
], t
[c
]); }
}
}
}
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHRpbWUuaD4KCnZvaWQgc2h1ZmZsZShpbnQgWyBdWzEzXSk7CnZvaWQgcHJpbnRfdHJ1bXAoaW50IFsgXVsxM10sIGludCosIGludCopOwppbnQgZGVja1s0XVsxM109e3t9LHt9fTsKaW50IHRydW1wX21hcmtbNF09ezEwMCwyMDAsMzAwLDQwMH07CmludCB0cnVtcF9udW1bMTNdPXsxLDIsMyw0LDUsNiw3LDgsOSwxMCwxMSwxMiwxM307CgoKaW50IG1haW4odm9pZCl7CgkKCXNyYW5kKHRpbWUoTlVMTCkpOwoJc2h1ZmZsZShkZWNrKTsKCXByaW50X3RydW1wKGRlY2ssdHJ1bXBfbWFyayx0cnVtcF9udW0pOwogICAgCiAgICByZXR1cm4gMDsKfQoKCnZvaWQgc2h1ZmZsZShpbnQgZGVja1tdWzEzXSl7CglpbnQgciwgYywgbnVtOwoJCglmb3IobnVtID0gMTsgbnVtIDw9IDUyOyBudW0rKyl7CgkJZG97CgkJCXIgPSByYW5kKCklNDsKCQkJYyA9IHJhbmQoKSUxMzsKCQl9d2hpbGUoZGVja1tyXVtjXSAhPSAwKTsKCQoJZ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