uva 10205 模拟

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

#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;
}
上一篇:hdu 1506 Largest Rectangle in a Histogram(单调栈)


下一篇:Winform 串口通讯之读卡器