Result: Accepted
Time: 6ms
Memory: 1768kB
#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<string>
#include<cmath>
using namespace std;
int a,b, n,t,k,sum,cnt,temp;
const int maxn=110;
char str[maxn][maxn];
char c;
int main(){
while(~scanf("%s",str[0])){
n=strlen(str[0]);
for(int i=0;i<n;i++){
if(str[0][i]=='A'||str[0][i]=='B'||str[0][i]=='C'||str[0][i]=='D'||str[0][i]=='E'||str[0][i]=='F'||str[0][i]=='G'||str[0][i]=='H'||str[0][i]=='I'||str[0][i]=='J'||str[0][i]=='K'||str[0][i]=='L'||str[0][i]=='M'||str[0][i]=='N'||str[0][i]=='O'||str[0][i]=='P'||str[0][i]=='Q'||str[0][i]=='R'||str[0][i]=='S'||str[0][i]=='T'||str[0][i]=='U'||str[0][i]=='V'||str[0][i]=='W'||str[0][i]=='X'||str[0][i]=='Y'){
str[0][i]+=33;
}
else if(str[0][i]=='Z')
str[0][i]='a';
else if(str[0][i]=='a'||str[0][i]=='b'||str[0][i]=='c'){
str[0][i]='2';
}
else if(str[0][i]=='d'||str[0][i]=='e'||str[0][i]=='f')
str[0][i]='3';
else if(str[0][i]=='g'||str[0][i]=='h'||str[0][i]=='i')
str[0][i]='4';
else if(str[0][i]=='j'||str[0][i]=='k'||str[0][i]=='l')
str[0][i]='5';
else if(str[0][i]=='m'||str[0][i]=='n'||str[0][i]=='o')
str[0][i]='6';
else if(str[0][i]=='p'||str[0][i]=='q'||str[0][i]=='r'||str[0][i]=='s')
str[0][i]='7';
else if(str[0][i]=='t'||str[0][i]=='u'||str[0][i]=='v')
str[0][i]='8';
else if(str[0][i]=='w'||str[0][i]=='x'||str[0][i]=='y'||str[0][i]=='z')
str[0][i]='9';
else continue;
}
puts(str[0]);
}
return 0;
}