模拟题 题目描述挺长的....

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <string>
#include <cstring>
#include <algorithm>
#include <iostream>
#define maxn 1010
#define INF 0x7fffffff
#define inf 10000000
#define MOD 34943
#define ull unsigned long long
#define ll long long
using namespace std;
char pp[55][25] = {"",
"2 of Clubs","3 of Clubs",
"4 of Clubs","5 of Clubs",
"6 of Clubs","7 of Clubs",
"8 of Clubs","9 of Clubs",
"10 of Clubs","Jack of Clubs",
"Queen of Clubs","King of Clubs",
"Ace of Clubs",
"2 of Diamonds","3 of Diamonds",
"4 of Diamonds","5 of Diamonds",
"6 of Diamonds","7 of Diamonds",
"8 of Diamonds","9 of Diamonds",
"10 of Diamonds","Jack of Diamonds",
"Queen of Diamonds","King of Diamonds",
"Ace of Diamonds",
"2 of Hearts","3 of Hearts",
"4 of Hearts","5 of Hearts",
"6 of Hearts","7 of Hearts",
"8 of Hearts","9 of Hearts",
"10 of Hearts","Jack of Hearts",
"Queen of Hearts","King of Hearts",
"Ace of Hearts",
"2 of Spades","3 of Spades",
"4 of Spades","5 of Spades",
"6 of Spades","7 of Spades",
"8 of Spades","9 of Spades",
"10 of Spades","Jack of Spades",
"Queen of Spades","King of Spades",
"Ace of Spades"
};
int shu[110][55], now[55], ans[55], n; void init()
{
memset(shu, 0, sizeof(shu));
for(int i = 1; i <= 52; ++ i) now[i] = i;
scanf("%d", &n);
for(int i = 1; i <= n; ++i)
for(int j = 1; j <= 52; ++ j)
scanf("%d", &shu[i][j]);
getchar();
}
void solve(int k)
{
for(int i = 1; i <= 52; ++ i)
ans[i] = now[shu[k][i]];
for(int i = 1; i <= 52; ++ i)
now[i] = ans[i];
}
int main()
{
int t, k;
scanf("%d", &t);
while(t --)
{
init();
char s[10];
while(gets(s) && s[0] != 0)
{
sscanf(s, "%d", &k);
solve(k);
}
for(int i = 1; i <= 52; ++ i)
puts(pp[ans[i]]);
if(t) puts("");
}
return 0;
}

uva 10205 模拟的更多相关文章

  1. UVa 12100 (模拟) Printer Queue

    用一个队列模拟,还有一个数组cnt记录9个优先级的任务的数量,每次找到当前最大优先级的任务然后出队,并及时更新cnt数组. #include <iostream> #include < ...

  2. UVa 101 (模拟) The Blocks Problem

    题意: 有n个木块及n个木块堆,初始状态是第i个木块在第i个木块堆上.对应有四种操作,然后输出最终状态. 分析: 用一个vector<int>模拟一个木块堆,进行相应操作即可. #incl ...

  3. 【每日一题】Flooded! UVA - 815 模拟阅读格式题

    https://cn.vjudge.net/problem/UVA-815 题意:给你一个矩阵,每个格子的数代表一个海拔并且每个格子的面积100平方米.给你整个区域的降水量(立方米),问降水量(米). ...

  4. UVA大模拟代码(白书训练计划1)UVA 401,10010,10361,537,409,10878,10815,644,10115,424,10106,465,10494

    白书一:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=64609#overview 注意UVA没有PE之类的,如果PE了显示WA. UVA ...

  5. 【紫书】 Unix ls UVA - 400 模拟

    题意:中文版https://vjudge.net/problem/UVA-400#author=Zsc1615925460 题解:首先读取字符,维护一个最长字符串长度M,再排序. 对于输出,写一个pr ...

  6. UVA - 11995 模拟

    #include<iostream> #include<cstdio> #include<algorithm> #include<cstdlib> #i ...

  7. UVA 10205 Stack 'em Up

    直接模拟就好. #include <map> #include <set> #include <list> #include <cmath> #incl ...

  8. Paper Folding UVA - 177 模拟+思路+找规律

    题目:题目链接 思路:1到4是很容易写出来的,我们先考虑这四种情况的绘制顺序 1:ru 2:rulu 3:rululdlu 4:rululdluldrdldlu 不难发现,相较于前一行,每一次增加一倍 ...

  9. uva 101 POJ 1208 The Blocks Problem 木块问题 vector模拟

    挺水的模拟题,刚开始题目看错了,poj竟然过了...无奈.uva果断wa了 搞清题目意思后改了一下,过了uva. 题目要求模拟木块移动: 有n(0<n<25)快block,有5种操作: m ...

随机推荐

  1. List.Select按字符串选择属性

    不知道大家有没有遇到这样的情况:List使用Lambda表达式的时候,想要选择项的某个属性列. 例如,选择编号ID: var idList=list.Select(o=>o.ID).ToList ...

  2. in C#,编译型常量(const)和运行时常量(readonly)

    readonly 关键字与 const 关键字不同. const 字段只能在该字段的声明中初始化. readonly 字段可以在声明或构造函数中初始化. 因此,根据所使用的构造函数, readonly ...

  3. OC3-xml文件解析

    <?xml version="1.0"?> <xml_api_reply version="1"> <cities> < ...

  4. 基于python yield机制的异步操作同步化编程模型

    又一个milestone即将结束,有了些许的时间总结研发过程中的点滴心得,今天总结下如何在编写python代码时对异步操作进行同步化模拟,从而提高代码的可读性和可扩展性. 游戏引擎一般都采用分布式框架 ...

  5. WCF之绑定

    NameSpace+Name作为服务元数据的唯一标示.BindingElement描述Binding的特征. 绑定表示通信信道的配置,定义C/S间的协议. 分为:传输信道(TCP,HTTP…),消息编 ...

  6. 解决win7 下 curl无法加载的问题

    最近分别在WIN7和Windows8 上分别安装php 高版本!都遇到了这个问题! 一.win7系统64位, apache2.2, php 5.35 vc6 版本 这个比较容易: 1. phpinfo ...

  7. C++ 11 之学习总结

    感慨时间过的好快,C++ 11出来都5年了,现在才开始学习,但为时也不晚: 主要是网上及身边的朋友大肆宣扬C++ 11的某些优化,弄得别人心里痒痒的,所以就花了3天学习了点基本知识,相对于整个C++ ...

  8. linux系统man查询命令等级与意义

    代号 意义 1 可执行程序和一般shell命令 2 系统调用函数 3 库函数 4 设备配置文件,通常在/dev下 5 配置文件,/ec下 6 游戏 7 协议及杂项 8 管理员命令 9 与内核相关

  9. MySQL基于实例sales创建自定义函数、视图、存储过程及触发器

    实例:数据库sales 1.客户表(Customer) 客户编号(CusNo) 姓名(CusName) 地址(Address) 电话(Tel) C001 杨婷 北京 010-5328953 C002 ...

  10. C# ProperTyGrid 自定义属性

    C# 如果要实现自定义属性必须要需要实现接口ICustomTypeDescriptor // 摘要:   //     提供为对象提供动态自定义类型信息的接口.   public interface ...