View Code of Problem 3851

#include<stdio.h>
#include<string.h>
int main()
{
	int t;
	char a[100]="qwertyuiopasdfghjklzxcvbnm";
	char b[100]="wertyuiop[sdfghjkl;xcvbnm,";
	char c[100]; 
	int i,j;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%s",c);
		int len=strlen(c);
		for(i=0;i<len;i++)
		{
			for(j=0;j<26;j++)
			{
				if(c[i]==b[j])
				{
					c[i]=a[j];
					break;
				}
			} 
		}
		printf("%s\n",c);
	}
	return 0;
} 

Double click to view unformatted code.


Back to problem 3851