10082 WERTYU

#include<stdio.h>
#include<string.h>
int main ()
{
    char a[52]={"`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./"};
    char b[100];
    int len ,i ,j;
    while(gets(b)!=NULL)
    {
        len=strlen(b);
        for(i=0;i<len;i++)
        {
            if(b[i]=='q'||b[i]=='a'||b[i]=='z'||b[i]==' ')
               printf("%c",b[i]);
            else
            {
                for(j=0;j<50;j++)
                {
                    if(b[i]==a[j])
                        printf("%c",a[j-1]);
                }
            }
        }
        printf("\n");
    }
}

时间: 2024-08-08 05:37:14

10082 WERTYU的相关文章

UVa 10082 - WERTYU

1.题目大意: 输入一个错位的字符串(字母全为大写),输出原本想打出的句子. 2.思路: 如果将每个输入字符所对应的应输出字符一一使用if或者switch,则过于繁琐.因此考虑使用常量数组实现. 3.应该注意的问题: (1) 在对常量数组赋值时,应考虑字符转义符的影响,反斜杠"\"的转义符应为"\\". (2) 小心控制访问数组的范围. 4.代码: #include"stdio.h" char s[] = "`1234567890-=Q

UVa10082 WERTYU

10082 WERTYUA 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 typedas 'K' and so on. You are to decode a message typed in this manner.InputInput consists of sev

UVa10082

10082 WERTYUA common typing error is to place the hands onthe keyboard one row to the right of the correctposition. So ‘Q’ is typed as ‘W’ and ‘J’ is typedas ‘K’ and so on. You are to decode a messagetyped in this manner.InputInput consists of severa

ACM今日学习总结(2015.08.16)

今日完成情况 UVa 第3章 数组与字符串 六道例题已全部完成. 例题3-1 272 - TEX Quotes 例题3-2 10082 - WERTYU 例题3-3 401 - Palindromes 例题3-4 340 - Master-Mind Hints 例题3-5 1583 - Digit Generator 例题3-6 1584 - Circular Sequence 十二道习题已完成(7道). 习题3-1 1585 - Score 习题3-2 1586 - Molar mass 习题

计划,,留

下面给出的题目共计560道,去掉重复的也有近500题,作为ACMer Training Step1,用1年到1年半年时间完成.打牢基础,厚积薄发. 一.UVaOJ http://uva.onlinejudge.org 西班牙Valladolid大学的程序在线评测系统,是历史最悠久.最著名的OJ. 一.<算法竞赛入门经典> 刘汝佳 (UVaOJ 351道题) 以下部分内容摘自:http://sdkdacm.5d6d.com/thread-6-1-1.html "AOAPC I"

算法竞赛入门经典+挑战编程+USACO

下面给出的题目共计560道,去掉重复的也有近500题,作为ACMer Training Step1,用1年到1年半年时间完成.打牢基础,厚积薄发.   一.UVaOJ http://uva.onlinejudge.org  西班牙Valladolid大学的程序在线评测系统,是历史最悠久.最著名的OJ.   二.<算法竞赛入门经典> 刘汝佳  (UVaOJ  351道题)  以下部分内容摘自:http://sdkdacm.5d6d.com/thread-6-1-1.html   "AO

(Step1-500题)UVaOJ+算法竞赛入门经典+挑战编程+USACO

下面给出的题目共计560道,去掉重复的也有近500题,作为ACMer Training Step1,用1年到1年半年时间完成.打牢基础,厚积薄发. 一.UVaOJ http://uva.onlinejudge.org 西班牙Valladolid大学的程序在线评测系统,是历史最悠久.最著名的OJ. 二.<算法竞赛入门经典> 刘汝佳  (UVaOJ  351道题)  以下部分内容摘自:http://sdkdacm.5d6d.com/thread-6-1-1.html “AOAPC I”是刘汝佳(大

POJ2538 ZOJ1884 UVA10082 WERTYU

问题链接:POJ2538 ZOJ1884 UVA10082 WERTYU.入门练习级题,用C语言编写程序. 这个问题是有关输入输出流处理和字符转换问题.将键盘上的字符放在数组中备查可以省去许多程序逻辑. 做了一个函数convert()封装字符转换功能,可以简化主函数的逻辑. AC的C语言程序如下: /* POJ2538 ZOJ1884 UVA10082 WERTYU */ #include <stdio.h> char s[]="`1234567890-=QWERTYUIOP[]\\

poj 2538 WERTYU

WERTYU Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8492   Accepted: 4063 Description 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