#include<iostream>
#include<string>
using namespace std;
int main(){
int t;
string s,str;
cin >> t;
while (t--){
cin >> s;
for (int n = 0; n < s.size(); n++){
if (s[n] == '-')
continue;
if (s[n] == '#')
cout << " ";
if (isdigit(s[n]) && !isdigit(s[n + 1]))
cout << char(16 + s[n]);
if (isdigit(s[n]) && isdigit(s[n + 1])){
if (s[n] == '1'){
cout << char(s[n + 1] + 26);
n++;
}
else if (s[n] == '2'){
cout << char(s[n + 1] + 36);
n++;
}
}
}
cout << endl;
}
}isdigit()判断一个字符是否为数字字符,如果为数字字符返回非零,否则返回0;杭电hdOJ1982 Kaitou Kid - The Phantom Thief (1)
最新推荐文章于 2017-05-06 13:45:00 发布
本文介绍了一个使用C++编写的字符串解码程序,该程序能够解析特定格式的字符串,并将其转换成相应的字符输出。通过isdigit()函数判断字符是否为数字,进而根据不同条件输出对应的解码结果。
417

被折叠的 条评论
为什么被折叠?



