Codeforces #831B: Keyboard Layout 题解
来源:互联网 发布:php cgi开发 编辑:程序博客网 时间:2024/06/03 17:52
这个题就简单的纯模拟就可以了
对于当前位,如果不是字母就直接输出,如果是字母就对应上面的表找到对应字符,注意大小写
#include <cstdio>#include <iostream>#include <cstring>#include <string>#include <cmath>#include <algorithm>#include <cstdlib>#include <utility>#include <map>#include <stack>#include <set>#include <vector>#include <queue>#include <deque>#include <bitset>#define x first#define y second#define mp make_pair#define pb push_back#define LL long long#define Pair pair<int,int>#define LOWBIT(x) x & (-x)using namespace std;const int zero_stand=1500;const int MOD=1e9+7;const int INF=0x7ffffff;const int magic=348;char a[100],b[100];char c[1048];char ans[1048];int pos[30];int main (){int i;scanf("%s%s%s",a,b,c);for (i=0;i<=25;i++) pos[a[i]-97]=i;int len=strlen(c);for (i=0;i<=len-1;i++){if (!isalpha(c[i])){ans[i]=c[i];continue;}if (isupper(c[i])){int num=c[i]-65;ans[i]=65+b[pos[num]]-97;continue;}if (islower(c[i])){int num=c[i]-97;ans[i]=97+b[pos[num]]-97;continue;}}puts(ans);return 0;}
阅读全文
0 0
- Codeforces #831B: Keyboard Layout 题解
- CodeForces 831B Keyboard Layouts
- Codeforces 831 B Keyboard Layouts
- CodeForces 831B-Keyboard Layouts
- codeforces 831B Keyboard Layouts
- CodeForces 831 B.Keyboard Layouts(水~)
- 趣题 CodeForces 111B题解
- Codeforces B. Taxi 算法题解
- codeforces-158B-Taxi题解
- Codeforces 707B Bakery 题解
- Codeforces 298B Sail 题解
- Codeforces #521B: Cubes 题解
- 【codeforces 752B】Santa Claus and Keyboard Check
- 【Codeforces 748 B Santa Claus and Keyboard Check】
- Codeforces 748B-Santa Claus and Keyboard Check
- Codeforces 748B Santa Claus and Keyboard Check
- 【CodeForces 748B 】Santa Claus and Keyboard Check
- Codeforces Round #424 (Div. 2) B. Keyboard Layouts(字符串)
- STC89C52MCU--软件实现系统复位
- codeforces 830A
- Android 2.3 NDK 配置
- Warning!!!
- android自动化测试中需要的使用avd等命令
- Codeforces #831B: Keyboard Layout 题解
- python文件操作
- 选择排序
- for循环增强(数组的遍历)
- 单片机显示时间,可以停止,修改分和时
- Wintows10系统 磁盘的有小图标改为平铺形式
- 测试初体验
- Bootstrap辅助类和响应式工具
- js事件应用--基础(事件对象、鼠标事件、键盘事件)