Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
124803 | 晏莞煜 | 字符替换 | C++ | Compile Error | 0 MS | 0 KB | 256 | 2025-07-12 16:02:23 |
#include<iostream> #include<cstring> using namespace std; int main(){ char c[200]; cin>>c; char a,b; cin>>a>>b; q=strlen(c); for(int i=0;i<q;i++){ if(c[i]==a){ c[i]=b; } } for(int i=0;i<q;i++){ cout<<c[i]; } return 0; }
Main.cc: In function 'int main()': Main.cc:9:2: error: 'q' was not declared in this scope q=strlen(c); ^