Compile Error

foo.cc: In function 'int main()':
foo.cc:8:2: error: expected '}' before 'else'
    8 |  else
      |  ^~~~
foo.cc:6:9: note: to match this '{'
    6 |  if(x<1){
      |         ^
foo.cc: At global scope:
foo.cc:11:2: error: expected unqualified-id before 'if'
   11 |  if(1<=x||x<10){
      |  ^~
foo.cc:16:2: error: expected unqualified-id before 'if'
   16 |  if(10<=x||x<15){
      |  ^~
foo.cc:21:2: error: expected unqualified-id before 'if'
   21 |  if(15<=x||x<30){
      |  ^~
foo.cc:26:2: error: expected unqualified-id before 'if'
   26 |  if(x>=30){
      |  ^~
foo.cc:31:2: error: 'cout' does not name a type
   31 |  cout<<y<<endl;
      |  ^~~~
foo.cc:32:1: error: expected declaration before '}' token
   32 | }
      | ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1022 分段函数
语言
C++
递交时间
2022-07-14 10:22:01
评测时间
2022-07-14 10:22:01
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes