Result: Accepted
Time: 3ms
Memory: 1120kB
#include<stdio.h>
#include<string.h>
int main(){
int i,j,k;
char str[1000];
while(gets(str)&&strlen(str)!=EOF){
for(i=0;i<strlen(str);i++){
if(str[i]==' ')
return 0;
}
for(i=0;i<strlen(str);i++){
if(str[i]>=65&&str[i]<=89){
str[i]=str[i]+33;
printf("%c",str[i]);
}
else if(str[i]==90)
printf("a");
else if(str[i]>=97&&str[i]<=99)
printf("2");
else if(str[i]>=100&&str[i]<=102)
printf("3");
else if(str[i]>=103&&str[i]<=105)
printf("4");
else if(str[i]>=106&&str[i]<=108)
printf("5");
else if(str[i]>=109&&str[i]<=111)
printf("6");
else if(str[i]>=112&&str[i]<=115)
printf("7");
else if(str[i]>=116&&str[i]<=118)
printf("8");
else if(str[i]>=119&&str[i]<=122)
printf("9");
else
printf("%c",str[i]);
if(i==strlen(str)-1)
printf("\n");
}
}
return 0;
}