?? 1008.cpp
字號(hào):
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <string>
using namespace std;
string a[]={"ABC","DEF","GHI","JKL","MNO","PQRS","TUV","WXYZ"};
string c1="QWERTYUIOPASDFGHJKLZXCVBNM",c2="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char hash[128];
int main(int argc, char** argv) {
char s[1001],b[1001],ans[1001];
int i,j,len,tmp;
// freopen("1008.in","r",stdin);
// freopen("1008.out","w",stdout);
for (i=0;i<26;i++)
hash[c1[i]]=c2[i];
while (gets(s))
{
for (i=j=0;s[i];i+=2,j++)
b[j]=hash[a[s[i]-'2'][s[i+1]-'1']];
b[j]=0;
ans[j]=0;
len=j/2+(j&1);
ans[j-1]=b[len-1];
tmp=i=0;j=len;
while (b[j])
{
ans[tmp++]=b[i++];
ans[tmp++]=b[j++];
}
puts(strrev(ans));
}
return (EXIT_SUCCESS);
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -