Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
58003 王嘉瑜 字符串替换 C++ Accepted 3 MS 300 KB 337 2023-09-16 20:53:08

Tests(10/10):


Code:

#include <iostream> #include <string> using namespace std; int main(){ string text,encode; cin>>text; cin>>encode; for(int i=0;i<text.size();i++){ if(text[i]>='A'&&text[i]<='Z'){ text[i] = encode[text[i]-'A'] - 32; } else{ text[i] = encode[text[i]-'a']; } } cout<<text; return 0; }