#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void shuffle(int deck[][13]);
void print_trump(int deck[][13], int* trump_mark, int* trump_num);
int main(void) {
int deck[4][13] = {0};
int trump_mark[4];
int trump_num[13];
for(int i=0;i<4;i++) {
trump_mark[i]=(i+1)*100;
for (int j=0;j<13;j++){
deck[i][j] = 0;
trump_num[j]=j+1;
}
}
shuffle(deck);
print_trump(deck,trump_mark,trump_num);
return 0;
}
void shuffle(int deck[][13]){
int c=0;
r++;
for (int a=0;a<4;a++){
for (int b=0;b<13;b++){
for(int d=0;d<c;d++){
if(deck[d/13][d%13]==r){
r++;
d=0;
}
}
deck[a][b]=r;
c++;
}
}
}
void print_trump(int deck[][13],int* trump_mark,int* trump_num){
for(int c=1;c<=52; c++){
for(int a=0;a<4;a++){
for(int b=0;b<13;b++){
if(deck[a][b]==c){
printf("%d:%d-%d\n",c
,trump_mark
[a
],trump_num
[b
]); }
}
}
}
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHRpbWUuaD4KIAp2b2lkIHNodWZmbGUoaW50IGRlY2tbXVsxM10pOwp2b2lkIHByaW50X3RydW1wKGludCBkZWNrW11bMTNdLCBpbnQqIHRydW1wX21hcmssIGludCogdHJ1bXBfbnVtKTsKIAppbnQgbWFpbih2b2lkKSB7CiAgICBpbnQgZGVja1s0XVsxM10gPSB7MH07CiAgICBpbnQgdHJ1bXBfbWFya1s0XTsKICAgIGludCB0cnVtcF9udW1bMTNdOwogCiAgICBmb3IoaW50IGk9MDtpPDQ7aSsrKSB7CiAgICAgICAgdHJ1bXBfbWFya1tpXT0oaSsxKSoxMDA7IAogICAgICAgIGZvciAoaW50IGo9MDtqPDEzO2orKyl7CiAgICAgICAgICAgIGRlY2tbaV1bal0gPSAwOyAKICAgICAgICAgICAgdHJ1bXBfbnVtW2pdPWorMTsgCiAgICAgICAgfQogICAgfQogCiAgICBzaHVmZmxlKGRlY2spOwogCiAKICAgIHByaW50X3RydW1wKGRlY2ssdHJ1bXBfbWFyayx0cnVtcF9udW0pOwogCiAgICByZXR1cm4gMDsKfQogCnZvaWQgc2h1ZmZsZShpbnQgZGVja1tdWzEzXSl7CiAgICBzcmFuZCh0aW1lKE5VTEwpKTsKICAgIGludCBjPTA7CglpbnQgcj1yYW5kKCklNTI7CglyKys7CiAgICBmb3IgKGludCBhPTA7YTw0O2ErKyl7CiAgICAgICAgZm9yIChpbnQgYj0wO2I8MTM7YisrKXsKICAgICAgICAJZm9yKGludCBkPTA7ZDxjO2QrKyl7CiAgICAgICAgCQlpZihkZWNrW2QvMTNdW2QlMTNdPT1yKXsKICAgICAgICAgICAgCXI9cmFuZCgpJTUyOwogICAgICAgICAgICAJcisrOwogICAgICAgICAgICAJZD0wOwogICAgICAgIAkJfQogICAgICAgIAl9CiAgICAgICAgZGVja1thXVtiXT1yOwogICAgICAgIGMrKzsKICAgICAgICB9CiAgICB9Cn0Kdm9pZCBwcmludF90cnVtcChpbnQgZGVja1tdWzEzXSxpbnQqIHRydW1wX21hcmssaW50KiB0cnVtcF9udW0pewogICAgZm9yKGludCBjPTE7Yzw9NTI7IGMrKyl7CiAgICAgICAgZm9yKGludCBhPTA7YTw0O2ErKyl7CiAgICAgICAgICAgIGZvcihpbnQgYj0wO2I8MTM7YisrKXsKICAgICAgICAgICAgICAgIGlmKGRlY2tbYV1bYl09PWMpewogICAgICAgICAgICAgICAgICAgIGlmKGM8MTApIHByaW50ZigiICIpOwogICAgICAgICAgICAgICAgICAgIHByaW50ZigiJWQ6JWQtJWRcbiIsYyx0cnVtcF9tYXJrW2FdLHRydW1wX251bVtiXSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0KIA==