Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
3599 杨洋杰 字符串替换 C++ Accepted 0 MS 292 KB 370 2024-06-17 19:50:10

Tests(10/10):


Code:

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