NUC1429 WERTYU【输入输出】
来源:互联网 发布:邮币卡抢单软件 编辑:程序博客网 时间:2024/06/02 02:56
WERTYU
时间限制: 1000ms 内存限制: 65535KB
通过次数: 1总提交次数: 1
问题描述
A common typing error is to place the hands on the keyboard one row to 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 in this manner.
输入描述
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 (`)]. Keys labelled with words [Tab, BackSp, Control, etc.] are not represented in the input.
输出描述
You are to replace each letter or punctuation symbol by the one immediately to its left on the QWERTY keyboard shown above. Spaces in the input should be echoed in the output.
样例输入
O S, GOMR YPFSU/
样例输出
I AM FINE TODAY.
来源
Waterloo local 2001.01.27
问题分析:(略)
这个问题和《POJ2538 ZOJ1884 UVA10082 WERTYU【输入输出】》是同一个问题,代码直接用就AC了。
程序说明:参见参考链接。
参考链接:POJ2538 ZOJ1884 UVA10082 WERTYU【输入输出】
题记:程序做多了,不定哪天遇见似曾相识的。AC的C++程序如下:
/* POJ2538 ZOJ1884 UVA10082 WERTYU */ #include <stdio.h> char s[]="`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./"; #define SIZE (int)sizeof(s) char convert(char c) { int i; for(i=1; i<SIZE; i++) if(s[i] == c) return s[i-1]; return c; } int main(void) { char c; while((c=getchar()) != EOF) putchar(convert(c)); return 0; }
阅读全文
0 0
- NUC1429 WERTYU【输入输出】
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU (WERTYU, UVa10082)
- 1897: WERTYU
- NUC1154 Vertical Histogram【打印图案】
- 基础
- NUC1131 Triangle【DP】
- 如何在一个类的实例被创建时调用它的内部方法!!!
- Secdo analyzer
- NUC1429 WERTYU【输入输出】
- Secdo response
- NUC1840 Graveyard Design【尺取法】
- 界面组件——按钮(Button)与图片按钮(ImageButton)
- Secdo observer
- NUC1776 Tiling Up Blocks【二维最长上升子序列+DP】
- 3、STM32联网驱动__接口方式_TCP/UDP协议栈_通信方式
- 利用Python实现基于Requests框架和多线程技术的Tumblr博客空间图片及视频下载
- 孩子兄弟表示法(二叉链表树) 时间 2014-06-02 16:32:17 CSDN博客 原文 http://blog.csdn.net/chdjj/article/details/2811164