View Code of Problem 3851

#include<iostream>
#include<string.h>
using namespace std;
int main()
{
	char a[29]={'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',','};
	char str[1000];
	int n;
	cin>>n;
	while(n--)
	{
		cin>>str;
		for(int i=0;i<strlen(str);i++)
		{
			for(int j=0;j<29;j++)
			{
			  if(str[i]==a[j]) 
			  {
			     cout<<a[j-1];
			     break;
			  }
			}			
		}
		cout<<endl;
	}
}


Double click to view unformatted code.


Back to problem 3851