View Code of Problem 3851

#include<stdio.h>
#include<string.h>
int main()
{
	char s[10010]="qwertyuiop[]asdfghjkl;'zxcvbnm,.";
	char tmp[10010],ch;
	int n,len1,len2,i,j;
	len2=strlen(s);
	scanf("%d",&n);
	while(n--){
		scanf("%s",tmp);
		//printf("%s\n",tmp);
		len1=strlen(tmp);
		for(i=0;i<len1;++i){
			ch=tmp[i];
			for(j=0;j<len2;++j){
				if(s[j]==ch){
					tmp[i]=s[j-1];
					break;
				}
			}
		}
		printf("%s\n",tmp);
		
	}
	
	return 0;
}

Double click to view unformatted code.


Back to problem 3851