View Code of Problem 3851

#include<iostream>
using namespace std;
int main()
{
	//char str[]={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,,};
    string str="qwertyuiop[asdfghjkl;zxcvbnm,",str1;
    int t;
    cin>>t;
    while(t--)
    {
    	cin>>str1;
    	
    	int len=str1.length();
    	
    	for(int i=0;i<len;i++)
    	{
    		for(int j=0;j<29;j++)
    		{
    			if(str1[i]==str[j])
    			{
    				cout<<str[j-1];
    				break;
				}
			}
		}
    	
    	cout<<endl;
    	
	}
}




Double click to view unformatted code.


Back to problem 3851