Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
62477 段文昊 字符替换 C++ Compile Error 0 MS 0 KB 209 2023-12-24 00:23:36

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { char s[201],a,b; cin>>a>>b; int n=strlen(s); for(int=t i=1;i<=n;i++){ if(s[i]==a){ s[i]=b; } } cout<<s; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:9:9: error: expected unqualified-id before '=' token
  for(int=t i=1;i<=n;i++){
         ^
Main.cc:9:9: error: expected ';' before '=' token
Main.cc:9:9: error: expected primary-expression before '=' token
Main.cc:9:10: error: 't' was not declared in this scope
  for(int=t i=1;i<=n;i++){
          ^
Main.cc:9:12: error: expected ';' before 'i'
  for(int=t i=1;i<=n;i++){
            ^
Main.cc:9:12: error: 'i' was not declared in this scope
Main.cc:9:15: error: expected ')' before ';' token
  for(int=t i=1;i<=n;i++){
               ^
Main.cc:9:16: error: 'i' was not declared in this scope
  for(int=t i=1;i<=n;i++){
                ^