下面是在 cpp.json 里面的配置:
{
"ready": {
"prefix": "ready",
"body": [
"#include<bits/stdc++.h>",
"using namespace std;",
"namespace sol{",
"\tvoid main(){",
"\t\t",
"\t}",
"}",
"int main(){",
"\tios::sync_with_stdio(false);",
"\tcin.tie(nullptr);",
"#ifndef DDEBUG",
"\tfreopen("cin.in","r",stdin);",
"#endif",
"\tsol::main();",
"\treturn 0;",
"}"
],
}
}
而在代码里面打出来是这样:
#include<bits/stdc++.h>
using namespace std;
namespace sol{
void main(){
}
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
#ifndef DDEBUG
freopen(
,
,stdin);
#endif
sol::main();
return 0;
}
中间的这个部分
#ifndef DDEBUG
freopen("cin.in","r",stdin);
#endif
被解析成了
#ifndef DDEBUG
freopen(
,
,stdin);
#endif
可能是 cpp.json 文件中的"\tfreopen("cin.in","r",stdin);",被解析成了什么奇怪的东西。
求解决方法。