View Code of Problem 3851

#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
using namespace std; 
char ss[29]={'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',','}; 
char find(char ch){
	for(int i=0;i<29;i++){
		if(ch==ss[i])
			return ss[i-1];
	}
}
int main(){

  	int t;
	scanf("%d",&t);
	char s2[101];
	for(int i=0;i<t;i++){
	 	scanf("%s",s2);
		char s1[101];
		int count=0;
	 	for(int j=0;j<strlen(s2);j++)
	 		s1[count++]=find(s2[j]);
		for(int j=0;j<count;j++)
			printf("%c",s1[j]);
		printf("\n");
		getchar();
	} 

	return 0;
}

Double click to view unformatted code.


Back to problem 3851