View Code of Problem 3851

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

Double click to view unformatted code.


Back to problem 3851