Compile Error

/in/foo.cc:4:5: error: cannot declare '::main' to be a global variable
    4 | int main{
      |     ^~~~
/in/foo.cc:5:9: error: expected primary-expression before 'int'
    5 |         int h,r,mj,pi=3.14159,ts;
      |         ^~~
/in/foo.cc:5:9: error: expected '}' before 'int'
/in/foo.cc:4:9: note: to match this '{'
    4 | int main{
      |         ^
/in/foo.cc:6:9: error: 'cin' does not name a type
    6 |         cin>>h>>r;
      |         ^~~
/in/foo.cc:7:9: error: 'mj' does not name a type
    7 |         mj=r * r * h * pi / 1000;
      |         ^~
/in/foo.cc:8:9: error: 'ts' does not name a type; did you mean 'tm'?
    8 |         ts=cill(20/mj);
      |         ^~
      |         tm
/in/foo.cc:9:9: error: 'cout' does not name a type
    9 |         cout<<ts;
      |         ^~~~
/in/foo.cc:10:9: error: expected unqualified-id before 'return'
   10 |         return 0;
      |         ^~~~~~
/in/foo.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^

信息

递交者
类型
递交
题目
P1000 大象喝水
语言
C++
递交时间
2025-11-07 20:44:51
评测时间
2025-11-07 20:44:51
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes