View Code of Problem 3851

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

Double click to view unformatted code.


Back to problem 3851