UVa 10082 WERTYU (water ver.)

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6


10082 - WERTYU

Time limit: 3.000 seconds

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1023

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 punction 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/


Output for Sample Input


I AM FINE TODAY.



完整代码:

/*0.013s*/

#include<cstdio>
const char s[] = "`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./";

int main(void)
{
	char c;
	int i;
	while (~(c = getchar()))
	{
		for (i = 1; s[i] && s[i] != c; i++)
			;
		putchar(s[i] ? s[i - 1] : c);
	}
	return 0;
}



阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

“UVa 10082 WERTYU (water ver.)” 的相关文章

活动图

活动图可以用于描述系统的工作流程和并发行为,它用于展现参与行为的类所进行的各种活动的顺序关系。 泳道是活动图中水平方向的区域划分,根据每个活动的职责对所有活动进行划分,每个泳道代表一个责任区。 http://dl.iteye.com/upload/attac...

重要概念之函数式编程

什么是函数式编程?函数式编程(Functional Programming, FP)就是利用纯函数实现细粒度的函数,然后再通过函数的组合把细粒度的函数组合成功能更强大的函数。函数式编程中的 "函数" 不是程序中的函数(方法),而是数学中的函数(映射关系),例如 y=sin(x) 中 x 和 y 的关...

Codeforces Round #173 (Div. 2) / 282C XOR and OR (字符串处理)_&字符串

C. XOR and OR http://codeforces.com/problemset/problem/282/C time limit per test memory limit per test input...

php如何实现访问页面但不跳转 - 编程语言

这篇文章主要介绍“php如何实现访问页面但不跳转”,在日常操作中,相信很多人在php如何实现访问页面但不跳转问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”php如何实现访问页面但不跳转”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!...

python AssertionError: Label class 错误原因 解决方法

AssertionError: Label class 提示类错误 比如yaml文件是这样的 train: ./pic/images/ val: ./pic/images/ nc: 2 names: [ ‘xiezi’, ‘yifu’ ] 错误发生在nc的值与你的labels中的txt文件的类...

C++ STL入门教程(7)——multimap(一对多索引),multiset(多元集合)的使用(附完整程序代码)_c++的multiset

一、multimap(一对多索引)C++ multimap和map所支持的操作相同(除了multimap不支持下标运算),但是multimap允许重复的元素。begin()返回指向第一个元素的迭代器clear()删除所有元素count()返回一个元素出现的次数empty()如果multimap为空则...