View Code of Problem 3851

#include <iostream>
#include <cstdio>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        string str="qwertyuiop[asdfghjkl;zxcvbnm,";
        char s[999];
        cin>>s;
        for(int i=0;i<strlen(s);i++){
            for(int j=0;j<str.length();j++){
                if(s[i]==str[j])
                    cout<<str[j-1];
            }
        }
        cout<<endl;
    }
    return 0;
}



















/*
Main.cc: In function 'int main()':
Main.cc:11:31: error: 'strlen' was not declared in this scope
         for(int i=0;i<strlen(s);i++){
                               ^
Main.cc:12:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(int j=0;j<str.length();j++){
                          ^
*/

Double click to view unformatted code.


Back to problem 3851