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

  1. #include <cstdio>
  2. #include <cstdlib>
  3. #include <cmath>
  4. #include <map>
  5. #include <set>
  6. #include <queue>
  7. #include <stack>
  8. #include <vector>
  9. #include <sstream>
  10. #include <string>
  11. #include <cstring>
  12. #include <algorithm>
  13. #include <iostream>
  14. #define maxn 1010
  15. #define INF 0x7fffffff
  16. #define inf 10000000
  17. #define MOD 34943
  18. #define ull unsigned long long
  19. #define ll long long
  20. using namespace std;
  21. char pp[55][25] = {"",
  22. "2 of Clubs","3 of Clubs",
  23. "4 of Clubs","5 of Clubs",
  24. "6 of Clubs","7 of Clubs",
  25. "8 of Clubs","9 of Clubs",
  26. "10 of Clubs","Jack of Clubs",
  27. "Queen of Clubs","King of Clubs",
  28. "Ace of Clubs",
  29. "2 of Diamonds","3 of Diamonds",
  30. "4 of Diamonds","5 of Diamonds",
  31. "6 of Diamonds","7 of Diamonds",
  32. "8 of Diamonds","9 of Diamonds",
  33. "10 of Diamonds","Jack of Diamonds",
  34. "Queen of Diamonds","King of Diamonds",
  35. "Ace of Diamonds",
  36. "2 of Hearts","3 of Hearts",
  37. "4 of Hearts","5 of Hearts",
  38. "6 of Hearts","7 of Hearts",
  39. "8 of Hearts","9 of Hearts",
  40. "10 of Hearts","Jack of Hearts",
  41. "Queen of Hearts","King of Hearts",
  42. "Ace of Hearts",
  43. "2 of Spades","3 of Spades",
  44. "4 of Spades","5 of Spades",
  45. "6 of Spades","7 of Spades",
  46. "8 of Spades","9 of Spades",
  47. "10 of Spades","Jack of Spades",
  48. "Queen of Spades","King of Spades",
  49. "Ace of Spades"
  50. };
  51. int shu[110][55], now[55], ans[55], n;
  52.  
  53. void init()
  54. {
  55. memset(shu, 0, sizeof(shu));
  56. for(int i = 1; i <= 52; ++ i) now[i] = i;
  57. scanf("%d", &n);
  58. for(int i = 1; i <= n; ++i)
  59. for(int j = 1; j <= 52; ++ j)
  60. scanf("%d", &shu[i][j]);
  61. getchar();
  62. }
  63. void solve(int k)
  64. {
  65. for(int i = 1; i <= 52; ++ i)
  66. ans[i] = now[shu[k][i]];
  67. for(int i = 1; i <= 52; ++ i)
  68. now[i] = ans[i];
  69. }
  70. int main()
  71. {
  72. int t, k;
  73. scanf("%d", &t);
  74. while(t --)
  75. {
  76. init();
  77. char s[10];
  78. while(gets(s) && s[0] != 0)
  79. {
  80. sscanf(s, "%d", &k);
  81. solve(k);
  82. }
  83. for(int i = 1; i <= 52; ++ i)
  84. puts(pp[ans[i]]);
  85. if(t) puts("");
  86. }
  87. return 0;
  88. }

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. hibernate get VS load

    1.  执行get方法:会立即加载对象      而执行load方法,若不适用该对象,则不会立即执行查询操作,而返回一个代理对象      get立即检索,load延迟检索  2.  load方法可能 ...

  2. 模板:abs用法

    c语言书本上说,数学函数除了求整数的绝对值函数abs()之外<abs() 定义在stdlib.h中>,其余的函数都在头文件 math.h 中定义,包括对浮点数求绝对值的函数fabs().c ...

  3. 解决Eclipse中Java工程间循环引用而报错的问题

    如果myeclipse  报如下错误 A cycle was detected in the build path of project 如果我们的项目包含多个工程(project),而它们之间又是循 ...

  4. mysql中按string字段排序

    如: Sql代码SELECT * FROM Student WHERE 1 = 1 ORDER BY -ID DESC或者: Sql代码SELECT * FROM Student WHERE 1 = ...

  5. HTML5应用开发:JavaScript库iScroll教程

    目录 1. iScroll介绍 2. 安装和使用 3. 简单的iScroll例子 4. Pinch & Zoom 5. Snap to element 6. iScroll 详细参数 1. i ...

  6. 浅谈 WPF布局

    我们首先来了解一下图形化用户界面(Graphic User Interface)也就是我们常常听到的GUI.举个简单的例子,同样是数据,我们可以用控制台程序加格式控制符等输出,但是这些都不如GUI来的 ...

  7. springMVC之事务配置(问题来源:为什么数据保存不了)

    参考文章:http://www.cnblogs.com/leiOOlei/p/3725911.html 自己的亲身体会,来源问题this.sessionFactory.getCurrentSessio ...

  8. 【转】Microsoft® SQL Server® 2012 Performance Dashboard Reports

    http://www.cnblogs.com/shanyou/archive/2013/02/12/2910232.html SQL Server Performance Dashboard Repo ...

  9. 非阻塞io与记录锁

    非阻塞io 1.对比 阻塞io的例子:scanf从终端获取输入时,如果不输入程序就会一直停在那; 对一个已经有写锁的文件请求读时, 会一直空等直到前面的进程释放锁... 非阻塞的例子:读取文件内容, ...

  10. Activity的Launch mode详解 singleTask正解

    Activity有四种加载模式:standard(默认), singleTop, singleTask和 singleInstance.以下逐一举例说明他们的区别: standard:Activity ...