您的位置:首页 > 其它

FZU 2034 Password table

2013-11-10 21:33 211 查看
FZU 2034 Password table                题目链接:http://acm.fzu.edu.cn/problem.php?pid=2034

模拟水

题目大意及分析:密码版加密,一一对应即可。

code:

#include<stdio.h>
#include<string.h>
int main()
{
//freopen("in.txt","r",stdin);
int m,n,p,i,j,k,t,len;
char c[50],g[10][10][2];
scanf("%d",&t);
for(k=1;k<=t;k++)
{
scanf("%d%d%d",&m,&n,&p);
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
scanf("%s",g[i][j]);
}
}
printf("Case %d:\n",k);
while(p--)
{
scanf("%s",c);
len=strlen(c);
for(i=0;i<len;i+=2)
{
printf("%c%c",g[c[i+1]-'1'][c[i]-'A'][0],g[c[i+1]-'1'][c[i]-'A'][1]);
}
printf("\n");
}
}
return 0;
}

PS:一wrong,sad……

今日最大收获:学会了freopen()的大概用法……
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: