求助,随手写的代码,编译失败,怎么看都没问题
  • 板块灌水区
  • 楼主hjsxhst2022
  • 当前回复4
  • 已保存回复4
  • 发布时间2022/8/10 10:03
  • 上次更新2023/10/27 16:10:42
查看原帖
求助,随手写的代码,编译失败,怎么看都没问题
745903
hjsxhst2022楼主2022/8/10 10:03
#include <iostream>
#include <cstring>
using namespace std;
int main(){
cout<<"{";
cout<<"\";
return 0;
}

错误提示:

编译失败
/tmp/compiler_6tzzf_ws/src:6:7: 警告:缺少结尾的 " 字符
    6 | cout<<"\";
      |       ^
/tmp/compiler_6tzzf_ws/src:6:7: 错误:缺少结尾的 " 字符
    6 | cout<<"\";
      |       ^~~~
/tmp/compiler_6tzzf_ws/src: 在函数‘int main()’中:
/tmp/compiler_6tzzf_ws/src:7:1: 错误:expected primary-expression before ‘return’
    7 | return 0;
      | ^~~~~~

luogu上的编译器的结果

2022/8/10 10:03
加载中...