fzu Password table

本文详细介绍了密码表在保护在线账户安全中的应用。通过输入特定格式的字母和数字,用户可以快速填写密码,确保账号信息安全。文章还提供了实例输入和输出,帮助读者理解密码表的工作原理。
G - Password table
Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u

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

1
8 5 2
94 62 80 00 24
79 11 07 80 03
32 66 12 89 48
57 82 36 69 32
54 66 91 54 93
12 14 37 92 83
52 70 33 89 95
59 91 01 80 69
A4B7D1
E5C3B2

Sample Output

Case 1:
577000
931211
 
水题一道
 
 
 
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    int i,j;
    int t,n,m,q;
    int num[20][20];
    scanf("%d",&t);
    int y;
    for(y=1;y<=t;y++)
    {

      //printf("Case %d:\n",t+1);
      scanf("%d%d%d",&n,&m,&q);
      for(i=1;i<=n;i++)
      {
         for(j=1;j<=m;j++)
         scanf("%d",&num[i][j]);
      }
     /* for(i=1;i<=n;i++)
      {
          for(j=1;j<=m;j++)
          printf("%d",num[i][j]);
          printf("\n");
      }*/
      char s[10];
      printf("Case %d:\n",y);
      while(q--)
      {
          scanf("%s",s);
          //printf("%d%d\n",s[0]-'A'+1,s[1]-48);
          for(i=0;i<6;i=i+2)
          {
              //printf("%d",num[s[i]-'A'+1][s[i+1]-48]);
              if(num[s[i+1]-48][s[i]-'A'+1]<=9)
              {
                  printf("0%d",num[s[i+1]-48][s[i]-'A'+1]);
              }
              else
              printf("%d",num[s[i+1]-48][s[i]-'A'+1]);

            }

           printf("\n");

      }














    }





    return 0;
}

 
 
 
 
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值