#include<stdio.h>
int main(){
int i, j, loop, time, flag=1, a[55]={0}, b[55]={0}, c[55]={0};
scanf("%d",&time);
for(i=1;i<55;++i){
scanf("%d",&a[i]);
}
for(i=1;i<55;i++)b[i]=i;
for(loop=0;loop<time;loop++){
for(i=1;i<55;i++){
j=a[i];
c[j]=b[i];
}
for(i=1;i<55;i++){b[i]=c[i];}
}
for(i=1;i<55;++i){
if(b[i]>=1&&b[i]<=13){printf("S");printf("%d",b[i]);flag++;}
if(b[i]>=14&&b[i]<=26){printf("H");printf("%d",b[i]-13);flag++;}
if(b[i]>=27&&b[i]<=39){printf("C");printf("%d",b[i]-26);flag++;}
if(b[i]>=40&&b[i]<=52){printf("D");printf("%d",b[i]-39);flag++;}
if(b[i]==53){printf("J1");flag++;}
if(b[i]==54){printf("J2");flag++;}
if(flag!=55)printf(" ");
}
return 0;
}
PAT-A1042
最新推荐文章于 2021-08-05 18:59:05 发布