Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
26823 | 唐心 | 破译邮件 | C++ | Accepted | 2 MS | 744 KB | 682 | 2022-05-24 17:05:16 |
#include <iostream> #include <cstdlib> #include <cstring> #include <cmath> using namespace std; int main() { int i,j,n,num,cnum=0; char str[200],str1[200]={0}; cin >>n; for(i=0;i<n;i++) { cin>>str; cnum = 0; num = strlen(str); for(j = 0; j < num;j++) { if(str[j]!='#'&&str[j]!='-') { cnum = cnum*10+str[j]-'0'; } else if(str[j]=='#'&&str[j-1]!='#'&&cnum!=0) { cout<<(char)(cnum+64); cnum = 0; } else if(str[j]=='-') { cout<<(char)(cnum+64); cnum = 0; } if(str[j]=='#') cout<<" "; } if(cnum!=0) cout<<(char)(cnum+64)<<endl; else cout<<endl; } return 0; }