Compile Error

foo.cc:1:5: error: 'cin' does not name a type
     cin >> x;
     ^~~
foo.cc:4:13: error: expected unqualified-id before 'if'
             if (x<1)
             ^~
foo.cc:7:13: error: expected unqualified-id before 'else'
             else if (1<=x && x<10)
             ^~~~
foo.cc:10:13: error: expected unqualified-id before 'else'
             else if (10<=x  && x<15)
             ^~~~
foo.cc:13:13: error: expected unqualified-id before 'else'
             else if (15<=x && x<30)
             ^~~~
foo.cc:16:13: error: expected unqualified-id before 'else'
             else
             ^~~~
foo.cc:18:13: error: 'cout' does not name a type
             cout << y;
             ^~~~
foo.cc:20:5: error: expected unqualified-id before 'return'
     return 0;
     ^~~~~~
foo.cc:21:1: error: expected declaration before '}' token
 }
 ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1021 分段函数
语言
C++
递交时间
2021-09-28 18:38:29
评测时间
2021-09-28 18:38:29
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes