#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
#define MAX 60
int start[MAX], endd[MAX], change[MAX];
int main()
{
//freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
for (int i = 1; i <= 54; i++)
start[i] = i;
int t = 0;
cin >> t;
for (int i = 1; i <= 54; i++)
cin >> change[i];
while (t--)
{
for (int i = 1; i <= 54; i++)
endd[change[i]] = start[i];
for (int i = 1; i <= 54; i++)
start[i] = endd[i];
}
//output
for (int i = 1; i <= 54; i++)
{
switch((endd[i]-1)/13)
{
case 0:
cout << 'S';
break;
case 1:
cout << 'H';
break;
case 2:
cout << 'C';
break;
case 3:
cout << 'D';
break;
case 4:
cout << 'J';
break;
}
if (endd[i]%13 != 0)
cout << endd[i]%13;
else
cout << 13;
if (i != 54)
cout << " ";
}
return 0;
}
PAT-A1042 Shuffling Machine(简单模拟)
最新推荐文章于 2022-03-01 17:11:03 发布