Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
12326 | 蒋瀚辉 | 【循环】字母译码(character) | C++ | Accepted | 2 MS | 732 KB | 336 | 2021-05-20 17:49:31 |
#include <bits/stdc++.h> using namespace std; string a; int len; int main() { getline(cin,a); len=a.size(); for(int i=0;i<len-1;i++) if(a[i]==' ') cout << '*'; else if(a[i]>='a' && a[i]<='z') cout << int(a[i]-'a'+1); else if(a[i]>='A' && a[i]<='Z') cout << int(a[i]-'A'+1); return 0; }