Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
71759 刘轻松 字符串替换 C++ Accepted 1 MS 296 KB 307 2024-04-27 16:19:47

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; string s,s1; int main(){ getline(cin,s); getline(cin,s1); int sl=s.length(); for(int i=0;i<sl;i++){ if(s[i]>='a'&&s[i]<='z'){ cout<<s1[s[i]-'a']; } else if(s[i]>='A'&&s[i]<='Z'){ cout<<char(s1[s[i]-'A']-32); } } return 0; }