View Code of Problem 3851

#include<stdio.h>
#include<string.h>
void main(){
	int i,l;
	char s1[100],s2[100],word[200];
	int t;
    word[119]='q',word[101]='w',word[114]='e',word[116]='r',word[121]='t',word[117]='y',word[105]='u',word[111]='i',word[112]='o',word[91]='p';
	word[115]='a',word[100]='s',word[102]='d',word[103]='f',word[104]='g',word[106]='h',word[107]='j',word[108]='k',word[59]='l';
	word[120]='z',word[99]='x',word[118]='c',word[98]='v',word[110]='b',word[109]='n',word[44]='m';
	scanf("%d\n",&t);
	while(t--){
		
		gets(s2);
		l=strlen(s2);
		for(i=0;i<l;i++)
			s1[i]=word[s2[i]];
		s1[i]='\0';
		puts(s1);
	}
}

Double click to view unformatted code.


Back to problem 3851