入门模拟—简单模拟—A 1042

#include
using namespace std;
int main()
{
    int k,seq[55],start[55],end[55];
    char map[5] = {'S','H','C','D','J'};
    cin >> k;
    for(int i=1;i<=54;i++)
    {
            cin >> seq[i];
            start[i] = i;
            end[i] = i;
    }
    for(int i=1;i<=k;i++)
    {
            for(int j=1;j<=54;j++)
            {
                    end[seq[j]] = start[j];
            }
            for(int j=1;j<=54;j++)
            {
                    start[j] = end[j];
            }
    }
    for(int j=1;j<=54;j++)
    {
            if(j != 1)
                 cout << " ";
            start[j]--;
            cout << map[start[j]/13] << start[j]%13+1;
    }
    cout<return 0;
}


你可能感兴趣的:(PAT算法训练)