2018年1月13日 星期六

UVA Q10082 - WERTYU

#include<iostream>
#include<iomanip>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
char a[10000],b[48]{'`','1','2','3','4','5','6','7','8','9','0','-','=',
               'Q','W','E','R','T','Y','U','I','O','P','[',']','\\',
               'A','S','D','F','G','H','J','K','L',';','\'',
               'Z','X','C','V','B','N','M',',','.','/'};
while(gets(a)){
    for(int x=0;x<strlen(a);x++){
        if(a[x]==' '){
            cout<<" ";
        }else{
            for(int y=0;y<strlen(b);y++){
                if(a[x]==b[y]){
                    cout<<b[y-1];
                }
            }
        }
    }
    cout<<endl;
}


system("pause");
return 0;
}

沒有留言:

張貼留言