PC 110301 || uva 10082 WERTYU //水题,但是PC格式错误,UVA AC
2011-07-21 11:17
489 查看
A common typing error is to place your hands on the keyboard one row to the right of the correct position. Then ``Q'' is typed as ``W'' and ``J'' is typed as ``K'' and so on. Your task is to decode a message typed in this manner.
这道题不难。。但是一直PE 让我很郁闷,后来在UVA 找到了,AC了!怨念。。。
Input
Input consists of several lines of text. Each line may contain digits, spaces, uppercase letters (except ``Q'', ``A'', ``Z''), or punctuation shown above [except back-quote (`)]. Keys labeled with words [Tab, BackSp, Control, etc.] are not represented in the input.Output
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.Sample Input
O S, GOMR YPFSU/
Sample Output
I AM FINE TODAY.
这道题不难。。但是一直PE 让我很郁闷,后来在UVA 找到了,AC了!怨念。。。
#include <stdio.h> char *s="`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./"; int main() { int i, c; while ((c=getchar())!=EOF) { for (i=1; s[i] && s[i]!=c; i++); if (s[i]) putchar(s[i-1]); else putchar(c); } return 0; }
相关文章推荐
- var dataObj=eval("("+data+")");//转换为json对象(解决在ajax返回json格式数据的时候明明正确的获取了返回值但是却就是进不去success方法的问题。格式错误)
- UVa - 10082 - WERTYU (常量数组的使用)
- POJ2538 ZOJ1884 UVA10082 WERTYU【输入输出+水题】
- WERTYU (WERTYU, UVa10082)
- UVa 10082 WERTYU (water ver.)
- 已成功与服务器建立连接,但是在登录过程中发生错误。 (provider: SSL Provider, error: 0 - 接收到的消息异常,或格式不正确。)
- "已成功与服务器建立连接,但是在登录过程中发生错误。 (provider: SSL Provider, error: 0 - 接收到的消息异常,或格式不正确。)"
- UVa 10082 - WERTYU (java版本)
- SQL server无法连接到LENOVO-PC,已成功与服务器建立连接,但是在登录过程中发生错误
- 几个UVa水题 ,紫书第三章例题1、2、3,UVa 272、10082、401, 提交ac了的
- abap中SE71里如何维护“段落格式”“Paragraph formats”以及回避错误“不能调用PC编辑器,未知段落格式”
- UVA 10082 WERTYU(水题)
- UVA 1593 Alignment of Code 注意格式问题。。以及可以用stringstream解决但是我没用
- UVa 400 (水题) Unix ls
- 关于日期格式的一次错误记录
- POJ1004,Financial Management,水题,注意格式控制
- UVa 272 Tex Quotes --- 水题
- CF Round422 Div2 PC(水题)
- UVA - 11384 Help is needed for Dexter 水题
- 解决jquery中jsonp格式跨域请求报parsererror的错误