View Code of Problem 3851

#include<iostream>
#include<string>
using namespace std;
int main(){
	string s1="qwertyuiop[";
	string s2="asdfghjkl;";
	string s3="zxcvbnm,";
	int T;
	cin>>T;
	while(T--){
		string str;
		cin>>str;
		for(int i=0;i<str.size();i++){
			if(s1.find(str[i])!=s1.npos){
				cout<<s1[s1.find(str[i])-1];
			}
			else if(s2.find(str[i])!=s2.npos){
				cout<<s2[s2.find(str[i])-1];
			}
			else if(s3.find(str[i])!=s3.npos){
				cout<<s3[s3.find(str[i])-1];
			}
		}
		cout<<endl;
	}
}

Double click to view unformatted code.


Back to problem 3851