UVA 10082 - WERTYU

13 篇文章 0 订阅
水题一个 写完了有点后悔,应该用switch 不应该用if  e
#include<stdio.h>
int main()
{
    char c;
    while(scanf("%c",&c)!=EOF)
    {
        if(c=='W') printf("Q");
        else if(c=='E') printf("W");
        else if(c=='R') printf("E");
        else if(c=='T') printf("R");
        else if(c=='Y') printf("T");
        else if(c=='U') printf("Y");
        else if(c=='I') printf("U");
        else if(c=='O') printf("I");
        else if(c=='P') printf("O");
        else if(c=='[') printf("P");
        else if(c==']') printf("[");
        else if(c=='S') printf("A");
        else if(c=='D') printf("S");
        else if(c=='F') printf("D");
        else if(c=='G') printf("F");
        else if(c=='H') printf("G");
        else if(c=='J') printf("H");
        else if(c=='K') printf("J");
        else if(c=='L') printf("K");
        else if(c=='X') printf("Z");
        else if(c=='C') printf("X");
        else if(c=='V') printf("C");
        else if(c=='B') printf("V");
        else if(c=='N') printf("B");
        else if(c=='M') printf("N");
        else if(c==',') printf("M");
        else if(c=='.') printf(",");
        else if(c=='/') printf(".");
        else if(c==';') printf("L");
        else if(c==39) printf(";");
        else if(c==92) printf("]");
        else if(c=='1') printf("`");
        else if(c=='2') printf("1");
        else if(c=='3') printf("2");
        else if(c=='4') printf("3");
        else if(c=='5') printf("4");
        else if(c=='6') printf("5");
        else if(c=='7') printf("6");
        else if(c=='8') printf("7");
        else if(c=='9') printf("8");
        else if(c=='0') printf("9");
        else if(c=='-') printf("0");
        else if(c=='=') printf("-");
        else if(c=='+') printf("-");
        else if(c=='_') printf(")");
        else if(c==')') printf("(");
        else if(c=='(') printf("*");
        else if(c=='*') printf("&");
        else if(c=='&') printf("^");
        else if(c=='^') printf("%");
        else if(c=='%') printf("$");
        else if(c=='$') printf("#");
        else if(c=='#') printf("@");
        else if(c=='@') printf("!");
        else if(c=='!') printf("~");
        else printf("%c",c);
    }
    return 0;
}

lse
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值