#include <iostream>
#include <vector>
using namespace std;
int n;
string card[54]={"S1","S2","S3","S4","S5","S6","S7","S8","S9","S10","S11","S12","S13",
"H1","H2","H3","H4","H5","H6","H7","H8","H9","H10","H11","H12","H13",
"C1","C2","C3","C4","C5","C6","C7","C8","C9","C10","C11","C12","C13",
"D1","D2","D3","D4","D5","D6","D7","D8","D9","D10","D11","D12","D13","J1","J2"};
int inde[54];
int tIndex[54];
vector<int> v;
int main(){
cin>>n;
int i;int tmp;
for(i=0;i<54;i++){
inde[i]=i;
}
while(cin>>tmp){
tmp--;
v.push_back(tmp);
}
while(n--){
for(i=0;i<54;i++){
tIndex[v[i]]=inde[i];
}
for(i=0;i<54;i++){
inde[i]=tIndex[i];
}
}
for(i=0;i<54;i++){
cout<<card[inde[i]];
if(i!=53){
cout<<" ";
}
}
return 0;
}

PAT1042. Shuffling Machine (20)的更多相关文章

  1. PAT 1042. Shuffling Machine (20)

    1042. Shuffling Machine (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Shu ...

  2. PAT1042:Shuffling Machine

    1042. Shuffling Machine (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Shu ...

  3. pat00-自测5. Shuffling Machine (20)

    00-自测5. Shuffling Machine (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue Sh ...

  4. A1042 Shuffling Machine (20)

    1042 Shuffling Machine (20)(20 分) Shuffling is a procedure used to randomize a deck of playing cards ...

  5. PAT 甲级 1042 Shuffling Machine (20 分)(简单题)

    1042 Shuffling Machine (20 分)   Shuffling is a procedure used to randomize a deck of playing cards. ...

  6. PAT 1042 Shuffling Machine (20 分)

    1042 Shuffling Machine (20 分)   Shuffling is a procedure used to randomize a deck of playing cards. ...

  7. PAT (Advanced Level) Practice 1042 Shuffling Machine (20 分) 凌宸1642

    PAT (Advanced Level) Practice 1042 Shuffling Machine (20 分) 凌宸1642 题目描述: Shuffling is a procedure us ...

  8. 数据结构练习 00-自测5. Shuffling Machine (20)

    Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techn ...

  9. 1042. Shuffling Machine (20) - sstream实现数字转字符串

    题目例如以下: Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffli ...

随机推荐

  1. box-sizing与calc()与flex

    1,Syntax: /* Keyword values */ box-sizing: content-box; box-sizing: border-box; /* Global values */ ...

  2. JZOJ.5275【NOIP2017模拟8.14】水管

    Description

  3. MVC 多种 数据验证 post

    技术:c# .net  采用mvc框架,实现model的数据验证. 刚开始觉得数据验证很方便,可以判断非空.数据正确性,但是后来发现很多需要数据库的判定还是需要post请求做,但是就想mvc的数据验证 ...

  4. 【BZOJ2962】序列操作 线段树

    [BZOJ2962]序列操作 Description 有一个长度为n的序列,有三个操作1.I a b c表示将[a,b]这一段区间的元素集体增加c,2.R a b表示将[a,b]区间内所有元素变成相反 ...

  5. 170208、用Navicat自动备份mysql数据库

    数据库备份很重要,很多服务器经常遭到黑客的恶意攻击,造成数据丢失,如果没有及时备份的话,后果不堪设想. 一:备份的目的: 做灾难恢复:对损坏的数据进行恢复和还原 需求改变:因需求改变而需要把数据还原到 ...

  6. CodeForces 156B Suspects(枚举)

    B. Suspects time limit per test 2 seconds memory limit per test 256 megabytes input standard input o ...

  7. Remoting在多IP多网卡内外网环境下的问题

    Remoting服务器端如果服务器有多块网卡,多个IP地址的情况下会出现客户端callback失败的问题,debug以后发现客户端会callback到服务器端另外一个IP地址(例如外网地址,而不是内网 ...

  8. Python菜鸟之路:Django ModelForm的使用

    一.简单使用案例 #views.py #views.py from django.shortcuts import render,HttpResponse from app01 import mode ...

  9. c++相关知识

    0.C语言基础知识及系统相关:http://c.biancheng.net/cpp/u/jiaocheng/ 1.C++ include观点与机制:http://developer.51cto.com ...

  10. JS让DIV绑定某个事件

    <html> <head> <title>Add/Remove Event Handlers Example</title> <script ty ...