View Code of Problem 3851

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

}

Double click to view unformatted code.


Back to problem 3851