View Code of Problem 3851

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

Double click to view unformatted code.


Back to problem 3851