View Code of Problem 3851

#include <stdio.h>
#include <string.h> 
int main(int argc, char *argv[])
{
	char str[30]={'q','w','e','r','t','y','u','i','o','p','[',']','a','s','d','f','g','h','j','k','l',';','z','x','c','v'
	,'b','n','m',','};
	int a[300]; 
	for(int i=0;i<30;i++){
		a[str[i]]=i;
	}
	int t;
	scanf("%d",&t);
	getchar();
	while(t--){
		char s[100];
		scanf("%s",s);
		getchar();
		for(int i=0;i<strlen(s);i++){
			printf("%c",str[a[s[i]]-1]);
		}
		printf("\n");
	}
	
	return 0;
}

Double click to view unformatted code.


Back to problem 3851