Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
159655 张蔚林 字符串替换 C++ Compile Error 0 MS 0 KB 301 2026-09-06 09:54:55

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:2: error: expected ';' before 'int'
  int n=s.length();
  ^
Main.cc:10:16: error: 'n' was not declared in this scope
  for(int i=0;i