记录详情

Compile Error

foo.cc: In function ‘int main()’:
foo.cc:7:12: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
    7 |         if(x==1)cout<<"No"<<endl;
      |            ^
foo.cc:7:15: error: unable to find numeric literal operator ‘operator"")cout’
    7 |         if(x==1)cout<<"No"<<endl;
      |               ^~~~~~~
foo.cc:7:15: note: use ‘-fext-numeric-literals’ to enable more built-in suffixes
foo.cc:8:9: error: expected primary-expression before ‘else’
    8 |         else if(x==2) cout<<"Yes"<<endl;
      |         ^~~~
foo.cc:7:35: error: expected ‘)’ before ‘else’
    7 |         if(x==1)cout<<"No"<<endl;
      |           ~                       ^
      |                                   )
    8 |         else if(x==2) cout<<"Yes"<<endl;
      |         ~~~~                       

信息

递交者
类型
自测
题目
A3-2 素数专题:素数判断
语言
C++
递交时间
2025-08-15 08:16:06
评测时间
2025-08-23 22:04:48
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes