1042ShufflingMachine(20分) [操作系统入门]

模拟题。
const int N=55;string mp[]={"S","H","C","D","J"};
string s[N];
string t[N];
int p[N];
int n;
int cnt;
void init()
{
    for(int i=0;i<4;i++)
        for(int j=1;j<=13;j++)
            s[cnt++]=mp[i]+to_string(j);
    s[cnt++]=mp[4]+‘1‘;
    s[cnt++]=mp[4]+‘2‘;
}
int main()
{
    init();
    cin>>n;
    for(int i=0;i<cnt;i++) cin>>p[i],p[i]--;
    while(n--)
    {
        for(int i=0;i<cnt;i++) t[i]=s[i];
        for(int i=0;i<cnt;i++) s[p[i]]=t[i];
    }
    for(int i=0;i<cnt;i++)
        if(i) cout<<‘ ‘<<s[i];
        else cout<<s[i];
    cout<<endl;
    //system("pause");
    return 0;
}
1042 Shuffling Machine (20 分)
以上是 1042ShufflingMachine(20分) [操作系统入门] 的全部内容, 来源链接: utcz.com/z/519493.html
