View Code of Problem 3851

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

char str1[100]="qwertyuiopasdfghjklzxcvbnm";
char str2[100]="wertyuiop[sdfghjkl;xcvbnm,";

int main(){
    int t,i,j;
    scanf("%d",&t);
    while(t--){
        char str[105],ans[105];
        int k=0;
        scanf("%s",str);
        for(i=0;i<strlen(str);i++){
            for(j=0;str[i]!=str2[j];j++);
            ans[k++]=str1[j];
        }
        for(i=0;i<k;i++){
            printf("%c",ans[i]);
        }
        printf("\n");
    }
	return 0;
}

Double click to view unformatted code.


Back to problem 3851