对于输入字符串数组的处理,三维数组
来源:互联网 发布:python项目开发实例 编辑:程序博客网 时间:2024/06/02 20:16
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
题目的意思,给出n*m的数组,然后给出e行cas、行数从1编号到n,列数从A到。。
给你字符串,求出对应的表中的数据
对于字符串数组的处理,可以使用三维数组
具体的见代码
#include <stdio.h>#include <iostream>#include <string.h>using namespace std;char map[15][15][15];char str[105];int main () {int cas;memset(map, 0, sizeof(map));scanf("%d", &cas);for (int t = 1; t <= cas; t ++) {int n, m, q;scanf("%d%d%d", &n, &m, &q);for (int i = 1; i <= n; i ++)for (int j = 0; j < m; j ++) {scanf("%s", &map[i][j]);}printf("Case %d:\n", t);for (int i = 0; i < q; i ++) {scanf("%s", str);int len = strlen(str);for(int i = 0; i < len; i += 2) {printf("%s", map[str[i + 1] - '0'][str[i]-'A']);}printf("\n");}}return 0;}
- 对于输入字符串数组的处理,三维数组
- fastjson 对于json数组字符串的处理
- d3对于数组的处理
- cpp:处理字符串与数字的混合输入(动态数组)
- 三维数组和三维数组的指针
- 三维数组的理解
- 三维数组的应用
- 三维数组的运用
- 三维数组的初始化
- 简单的三维数组
- Java数组的应用:案例:杨辉三角,三维数组,字符串数组
- 三维数组
- 三维数组
- 三维数组
- 三维数组
- 三维数组
- 对于数组的理解
- PHP 二维/三维数组转字符串
- pictureEdit 可以直接绑定Image 或者 Byte Array
- 解决subActivity里弹出框报错问题
- MFC中写文件时,如何将文件的属性修改为Unicode编码
- MC新手入门(四十九)------ 文件操作
- 谷歌开发工具android studio启动不了的解决方法
- 对于输入字符串数组的处理,三维数组
- 复选框单选
- CLR线程池的作用与原理介绍
- 【Linux操作系统分析】计算机是怎样工作的
- latex 如何使用bib产生多种文献格式
- dimension reduce(梯度下降)self-organizing maps(自组织映射)
- MC新手入门(五十)------服务器连接 一
- HDU 4288 && Codeforces 85D (线段树+离散化+离线处理)
- 关于NavigationBar的View的一些设置