Result: Accepted
Time: 3ms
Memory: 1120kB
#include<stdio.h>
#include<math.h>
#include<string.h>
int main() {
int i,j,k=0;
int n;
char auto a[105];
while(scanf("%s",a)!=EOF) {
k=strlen(a);
for(i=0;i<k;i++){
if(a[i]=='a'||a[i]=='b'||a[i]=='c') printf("2");
else if(a[i]==1) printf("1");
else if(a[i]=='d'||a[i]=='e'||a[i]=='f')printf("3");
else if(a[i]=='g'||a[i]=='h'||a[i]=='i')printf("4");
else if(a[i]=='j'||a[i]=='k'||a[i]=='l')printf("5");
else if(a[i]=='m'||a[i]=='n'||a[i]=='o')printf("6");
else if(a[i]=='p'||a[i]=='r'||a[i]=='q'||a[i]=='s')printf("7");
else if(a[i]=='t'||a[i]=='u'||a[i]=='v')printf("8");
else if(a[i]=='y'||a[i]=='w'||a[i]=='x'||a[i]=='z')printf("9");
else if(a[i]=='A') printf("b");
else if(a[i]=='B') printf("c");
else if(a[i]=='C') printf("d");
else if(a[i]=='D') printf("e");
else if(a[i]=='E') printf("f");
else if(a[i]=='F') printf("g");
else if(a[i]=='G') printf("h");
else if(a[i]=='H') printf("i");
else if(a[i]=='I') printf("j");
else if(a[i]=='J') printf("k");
else if(a[i]=='K') printf("l");
else if(a[i]=='L') printf("m");
else if(a[i]=='M') printf("n");
else if(a[i]=='N') printf("o");
else if(a[i]=='O') printf("p");
else if(a[i]=='P') printf("q");
else if(a[i]=='Q') printf("r");
else if(a[i]=='R') printf("s");
else if(a[i]=='S') printf("t");
else if(a[i]=='T') printf("u");
else if(a[i]=='U') printf("v");
else if(a[i]=='V') printf("w");
else if(a[i]=='W') printf("x");
else if(a[i]=='X') printf("y");
else if(a[i]=='Y') printf("z");
else if(a[i]=='Z') printf("a");
else printf("%c",a[i]);
}
printf("\n");
}
}