#include<iostream>
struct card{
int num;
char mark;//S,H,C,D
};
using namespace std;
void sort_card(card*init,int order[],card*changed){
for (int i = 1; i <= 54; ++i)
changed[order[i]]=init[i];
}
int main(){
int K;
card init[55];
card changed[55];
for (int i = 1; i <= 13; ++i)
init[i]={i,'S'};
for (int i = 14; i <= 26; ++i)
init[i]={i-13,'H'};
for (int i = 27; i <= 39; ++i)
init[i]={i-2*13,'C'};
for (int i = 40; i <= 52; ++i)
init[i]={i-3*13,'D'};
init[53]={1,'J'};
init[54]={2,'J'};
cin>>K;
int order[55];
for (int i = 1; i <= 54; ++i)
cin>>order[i];
for (int i = 1; i <= K; ++i){
sort_card(init,order,changed);
for (int j = 1; j <= 54; ++j)
init[j]=changed[j];
}
for (int i = 1; i <= 53; ++i)
cout<<init[i].mark<<init[i].num<<" ";
cout<<init[54].mark<<init[54].num;
return 0;
}
1042 Shuffling Machine (20 分)
最新推荐文章于 2020-09-08 10:47:55 发布