View Code of Problem 3851

#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
using namespace std;
int main(void){
	string s1="qwertyuiopasdfghjklzxcvbnm";
	string s2="wertyuiop[sdfghjkl;xcvbnm,";
	int t;
	cin>>t;
	getchar();
	while(t--){
		string s;
		cin>>s;
		for(int i=0;i<s.length();i++){
			for(int j=0;j<s2.length();j++){
				if(s[i]==s2[j]){
					cout<<s1[j];
					break;
				}
			}
		}
		cout<<endl;
	}
}

Double click to view unformatted code.


Back to problem 3851