WERTYU
来源:互联网 发布:c语言读文本文件 编辑:程序博客网 时间:2024/05/01 21:08
Problem Description
A common typing error is to place the hands on the keyboard one rowto the right of the correct position. So "Q" is typed as "W" and"J" is typed as "K" and so on. You are to decode a message typed inthis manner.
Input
Input consists of several lines of text.Each line may contain digits, spaces, upper case letters (except Q,A, Z), or punctuation shown above [except back-quote (`)]. Keyslabelled with words [Tab, BackSp, Control, etc.] are notrepresented in the input.
Output
You are to replace each letter orpunctuation symbol by the one immediately to its left on the QWERTYkeyboard shown above. Spaces in the input should be echoed in theoutput.
Sample Input
O S, GOMRYPFSU/
Sample Output
I AM FINETODAY.
#include <stdio.h>#include <stdlib.h>int main(){ char s[] = "`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./"; int c; char* p; while((c=getchar())!=EOF) { p = s; while(*p) { if(*p == c)break; p++; } if(*p)putchar(p[-1]); else putchar(c); } return 0;}
0 0
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU (WERTYU, UVa10082)
- 1897: WERTYU
- WERTYU(p2538)
- 文章标题
- JQuery的Ajax()向后台传参方式
- Git 操作标签
- 程序设计基石与实践系列之按值传递还是按引用
- 判断浮点数是否等于0
- WERTYU
- JavaScript权威指南学习之第4章 表达式和运算符
- 文章标题
- 静态代码块-非静态代码块-默认构造方法
- Git 使用GitHub
- LintCode | Easy | 翻转二叉树 | Invert Binary Tree
- Debug---Eclipse断点调试基础
- Git 自定义Git
- Ubuntu 15.04趟坑笔记