[UVa] WERTYU(10080)

简直水到爆炸的题目,还做了这么久,简直智商拯救无望:)

ac代码:

#include <cstdio>
#include <cstring>
using namespace std;
char str[] = "`1234567890-=QWERTYUIOPP[]\\ASDFGHJKL;‘ZXCVBNM,./";
int main() {
    char c;
    while(scanf("%c", &c) != EOF){
        int i;
        for (i = 0; str[i]&&str[i] != c; i++);
        if(str[i]) printf("%c",str[i - 1]);
        else printf("%c", c);
    }
    return 0;
}
时间: 2024-10-22 17:57:55

[UVa] WERTYU(10080)的相关文章

Gopher II UVA 10080,最后被抓的地鼠有多少只?

. Gopher II UVA, 10080 Time Limit: 3000 MS The gopher family, having averted the canine threat, must face a new predator. The are n gophers and m gopher holes, each at distinct (x, y) coordinates. A hawk arrives and if a gopher does not reach a hole

二分图匹配(匈牙利算法) UVA 10080 Gopher II

题目传送门 1 /* 2 匈牙利算法:这题比UVA_670简单,注意是要被吃的鼠的最少个数,套模板 3 */ 4 #include <cstdio> 5 #include <algorithm> 6 #include <cstring> 7 #include <cmath> 8 #include <vector> 9 using namespace std; 10 11 const int MAXN = 1e2 + 10; 12 const in

UVa 10082 - WERTYU

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

UVA 562 Dividing coins --01背包的变形

01背包的变形. 先算出硬币面值的总和,然后此题变成求背包容量为V=sum/2时,能装的最多的硬币,然后将剩余的面值和它相减取一个绝对值就是最小的差值. 代码: #include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; #define N 50007 int c[102],d

UVA 10341 Solve It

Problem F Solve It Input: standard input Output: standard output Time Limit: 1 second Memory Limit: 32 MB Solve the equation: p*e-x + q*sin(x) + r*cos(x) + s*tan(x) + t*x2 + u = 0 where 0 <= x <= 1. Input Input consists of multiple test cases and te

UVA 11014 - Make a Crystal(容斥原理)

UVA 11014 - Make a Crystal 题目链接 题意:给定一个NxNxN的正方体,求出最多能选几个整数点.使得随意两点PQ不会使PQO共线. 思路:利用容斥原理,设f(k)为点(x, y, z)三点都为k的倍数的点的个数(要扣掉一个原点O).那么全部点就是f(1),之后要去除掉共线的,就是扣掉f(2), f(3), f(5)..f(n).n为素数.由于这些素数中包括了合数的情况,而且这些点必定与f(1)除去这些点以外的点共线,所以扣掉.可是扣掉后会扣掉一些反复的.比方f(6)在f

[UVa] Palindromes(401)

UVA - 401 Palindromes Time Limit: 3000MS   Memory Limit: Unknown   64bit IO Format: %lld & %llu Submit Status Description A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string "ABCDED

uva 401.Palindromes

题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=342 题目意思:给出一段字符串(大写字母+数字组成).判断是否为回文串 or 镜像串 or 回文镜像串 or 什么都不是.每个字母的镜像表格如下 Character Reverse Character Reverse Character Reverse A A M M Y Y B

[2016-02-19][UVA][129][Krypton Factor]

UVA - 129 Krypton Factor Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu Submit Status Description You have been employed by the organisers of a Super Krypton Factor Contest in which contestants have very high mental and physica