Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
159412 Kevin 字符串替换 C++ Accepted 2 MS 280 KB 578 2026-08-30 17:00:15

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; char s[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; char s1[1000000]; char s2[26]; int main() { cin>>s1>>s2; int len=strlen(s1); char t; int cnt; for(int i=0;i<len;i++){ if(s1[i]>='A'&&s1[i]<='Z'){ t=s1[i]+32; } else{ t=s1[i]; } for(int j=0;j<=25;j++){ if(t==s[j]){ cnt=j; break; } } if(s1[i]>='A'&&s1[i]<='Z'){ cout<<char(s2[cnt]-32); } else{ cout<<s2[cnt]; } } return 0; }