Compile Error

foo.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main(
      |     ^~~~
foo.cc:5:9: error: expected primary-expression before 'int'
    5 |         int a,b,c,d;
      |         ^~~
foo.cc:5:9: error: expected '}' before 'int'
foo.cc:4:1: note: to match this '{'
    4 | {
      | ^
foo.cc:4:2: error: expected ')' before 'int'
    4 | {
      |  ^
      |  )
    5 |         int a,b,c,d;
      |         ~~~
foo.cc:3:9: note: to match this '('
    3 | int main(
      |         ^
foo.cc:5:15: error: 'b' was not declared in this scope
    5 |         int a,b,c,d;
      |               ^
foo.cc:5:17: error: 'c' was not declared in this scope
    5 |         int a,b,c,d;
      |                 ^
foo.cc:5:19: error: 'd' was not declared in this scope
    5 |         int a,b,c,d;
      |                   ^
foo.cc:6:9: error: 'cin' does not name a type
    6 |         cin>>a>>b>>c;
      |         ^~~
foo.cc:7:9: error: expected unqualified-id before 'if'
    7 |         if(a>b)
      |         ^~
foo.cc:11:9: error: expected unqualified-id before 'if'
   11 |         if(a>c)
      |         ^~
foo.cc:15:9: error: expected unqualified-id before 'if'
   15 |         if(b>c)
      |         ^~
foo.cc:19:9: error: 'cout' does not name a type
   19 |         cout<<a<<" "<<b<<" "<<c;
      |         ^~~~
foo.cc:20:9: error: expected unqualified-id before 'return'
   20 |         return 0;
      |         ^~~~~~
foo.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1020 3个数排序
语言
C++
递交时间
2023-12-01 16:30:17
评测时间
2023-12-01 16:30:17
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes