View Code of Problem 3851

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

Double click to view unformatted code.


Back to problem 3851