Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
113986 | 石茂诤 | 字符串替换 | C++ | Accepted | 1 MS | 296 KB | 363 | 2025-03-18 13:40:21 |
#include <iostream> #include <cstring> using namespace std; int main() { string str , ex ; cin >> str >> ex; for(int i = 0 ; i < str.length() ; i++) { if('A' <= str[i] && str[i] <= 'Z') str[i] = ex[str[i] - 'A'] - 32; else if('a' <= str[i] && str[i] <= 'z') str[i] = ex[str[i] - 'a']; } cout << str << endl; return 0 ; }