Result: Accepted
Time: 3ms
Memory: 1120kB
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<ctype.h>
int main()
{
char str[1000];
int i,len;
while(scanf("%s",str)!=EOF)
{
len=strlen(str);
for(i=0;i<len;i++)
{
if(str[i]>='A'&&str[i]<'Z')
{
printf("%c",str[i]+33);
}
else if(str[i]=='Z')
{
printf("a");
}
else if(str[i]>='a'&&str[i]<='c')
printf("2");
else if(str[i]>='d'&&str[i]<='f')
printf("3");
else if(str[i]>='g'&&str[i]<='i')
printf("4");
else if(str[i]>='j'&&str[i]<='l')
printf("5");
else if(str[i]>='m'&&str[i]<='o')
printf("6");
else if(str[i]>='p'&&str[i]<='s')
printf("7");
else if(str[i]>='t'&&str[i]<='v')
printf("8");
else if(str[i]>='w'&&str[i]<='z')
printf("9");
else
printf("%c",str[i]);
}
printf("\n");
}
return 0;
}