代码改变世界

UVa 10082 WERTYU

2012-03-21 22:48  Rollen Holt  阅读(426)  评论(0编辑  收藏  举报
#include<stdio.h>
int main()
{
    /*
    freopen("data.in","r",stdin);
    freopen("data.out","w",stdout);
    //*/
    const char s[]="`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./";
    char c;
    while((c=getchar())!=EOF)
    {
       long i;
       for(i=1;s[i]&&s[i]!=c;i++)
         ;
       if(s[i])
         putchar(s[i-1]);
       else
         putchar(c);
    }
return 0;
}