Problem Description
Do you know password table? A password table is used to protect the security of the online account. When a user needs to login to his/her online account or pay for money, he/she may need to fill in the password according to his/her own password table. For
example, if one user has the following table and the online system requires him/her to input the password of “A4B7D1”, he/she may input “577000”.
Input
The first line of the input contains an integer T(T≤100), indicating the number of test cases. The first line of each case contains three numbers n(5≤n≤9), m(5≤m≤9) and q(1≤q≤100) representing the length and width of the password table, and the total number
of queries (Look at the password table above, its length is 8 and its width is 5). Each of the following n lines contains m numbers, representing the given password table.
Then, each of the following q lines represents a query with the format of "L1D1L2D2L3D3" (L1, L2 and L3 are letters. D1, D2 and D3 are digits), just like the example in paragraph one.
Output
For each test case, print a line containing the test case number (beginning with 1). For each query in one test case, please output its corresponding password in one line.
Sample Input
18 5 294 62 80 00 2479 11 07 80 0332 66 12 89 4857 82 36 69 3254 66 91 54 9312 14 37 92 8352 70 33 89 9559 91 01 80 69A4B7D1E5C3B2
Sample Output
Case 1:577000931211
Source
2011年全国大学生程序设计邀请赛(福州)
题意:略
思路:水。
代码;
#include <stdio.h>
#include <string.h>
int t, n, m, q;
char g[10][10][1005];
void init() {
scanf("%d%d%d", &n, &m, &q);
for (int i = 0; i < n; i ++)
for (int j = 0; j < m; j ++)
scanf("%s", g[i][j]);
}
void solve() {
char s[10]; int x, y;
while (q--) {
scanf("%s", s);
for (int i = 0; i < 3; i ++) {
y = s[i * 2] - 'A'; x = s[i * 2 + 1] - '0' - 1;
printf("%s", g[x][y]);
}
printf("\n");
}
}
int main() {
int cas = 0;
scanf("%d", &t);
while (t--) {
init();
printf("Case %d:\n", ++cas);
solve();
}
return 0;
}
分享到:
相关推荐
求最大乘积 的源代码 次题是fzu 4月月赛题 是一道数学题啊
fzu online judge 的几道题,我的解题过程与思路,虽然都是很easy的题目,不过,重在参与嘛,哈哈
2021FZU计算机视觉作业(九)
2021FZU计算机视觉作业(七)
2021FZU计算机视觉作业(八)
2021FZU计算机视觉期末复习
不要下载此版的,请下载最新的http://download.csdn.net/source/1664620 离线版的福大acm在线评测OJ系统题目 更新到2009年8月 (注:chm电子书格式化)
fzu大数据基础实验4
C#miniword完整版,FZU作业,MINIWORD
FZU软件工程web课程复习资料-整理
FZU2021计算机视觉慕课答案(一)
FZU软件工程操作系统课程复习资料-整理
这是关于我们飞跃手册项目的相关文档,包括成员分组信息表格,各组成员任务概要文档,项目日记等文档。 (This is a collection of documents relating to our Leapfrog Handbook project, including member ...
FZU2021计算机视觉答案(三)
FZU2021计算机视觉答案(四)
2021FZU计算机视觉答案(五)
2021FZU计算机视觉答案(二 )
2021FZU计算机视觉答案(六)
2011 ACM 多校联合 2011 MU11 13 FZU
ACM数学_FZU...............绝密..........