View Code of Problem 3851

#include<stdio.h>
#include<string.h>
void main(){
	int i,l,j;
	char s1[100],s2[100],w1[30]="qwertyuiopasdfghjklzxcvbnm",w2[30]="wertyuiop[sdfghjkl;xcvbnm,";
	int t;
	scanf("%d\n",&t);
	while(t--){
		gets(s2);
		l=strlen(s2);
		for(i=0;i<l;i++){
			for(j=0;j<strlen(w2);j++){
				if(s2[i]==w2[j]){
					s1[i]=w1[j];
				}
			}
		}	
		s1[i]='\0';
		puts(s1);
	}
}

Double click to view unformatted code.


Back to problem 3851