Result: Accepted
Time: 3ms
Memory: 1756kB
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<map>
#include<math.h>
#include<map>
using namespace std;
const int maxn=100020;
const int inf=0x3f3f3f;
int main(){
char a[200];
char b[200];
memset(a,0,sizeof a);
memset(b,0,sizeof b);
while(scanf("%s",a)!=EOF){
int l=strlen(a);
for(int i=0;i<l;i++){
if(a[i]>='a'&&a[i]<='z'){
if(a[i]=='a'||a[i]=='b'||a[i]=='c') b[i]='2';
else if(a[i]=='d'||a[i]=='e'||a[i]=='f') b[i]='3';
else if(a[i]=='g'||a[i]=='h'||a[i]=='i') b[i]='4';
else if(a[i]=='j'||a[i]=='k'||a[i]=='l') b[i]='5';
else if(a[i]=='m'||a[i]=='n'||a[i]=='o') b[i]='6';
else if(a[i]=='p'||a[i]=='q'||a[i]=='r'||a[i]=='s') b[i]='7';
else if(a[i]=='t'||a[i]=='u'||a[i]=='v') b[i]='8';
else if(a[i]=='w'||a[i]=='x'||a[i]=='y'||a[i]=='z') b[i]='9';
}
else if(a[i]>='A'&&a[i]<='Z'){
b[i]=char((a[i]-'A'+1)%26+'a');
}
else{
b[i]=a[i];
}
}
printf("%s\n",b);
memset(a,0,sizeof a);
memset(b,0,sizeof b);
}
}