10082 - WERTYU (UVA)

题目链接如下:

Online Judge

我的代码如下:

#include 
#include 

int main(){
    const char s[] = "1234567890-=WERTYUIOP[]\\SDFGHJKL;'XCVBNM,./";
    const char t[] = "`1234567890-QWERTYUIOP[]ASDFGHJKL;ZXCVBNM,.";
    char c;
    while((c = getchar()) != EOF){
        if(strchr(s, c)){
            printf("%c", t[strchr(s, c) - s]);
        } else{
            printf("%c", c);
        }
    }
    return 0;
}

你可能感兴趣的:(UVA,算法)