/ SeriousOJ /

Record Detail

Compile Error

foo.cc: In function 'int main()':
foo.cc:7:28: error: expected '}' before ')' token
    7 |         int mn=min({a,b,c,d)};
      |                    ~       ^
foo.cc:7:29: error: expected ',' or ';' before '}' token
    7 |         int mn=min({a,b,c,d)};
      |                             ^
foo.cc: At global scope:
foo.cc:8:16: error: cannot resolve overloaded function 'max' based on conversion to type 'int'
    8 |         int mx=max{(a,b,c,d)};
      |                ^~~
foo.cc:10:9: error: 'cout' does not name a type
   10 |         cout<<mn<<endl<<mx;
      |         ^~~~
foo.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^

Code

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	int mn=min({a,b,c,d)};
	int mx=max{(a,b,c,d)};
	
	cout<<mn<<endl<<mx;
}

Information

Submit By
Type
Pretest
Problem
P1022 Minmax
Language
C++17 (G++ 13.2.0)
Submit At
2024-07-18 06:01:44
Judged At
2024-07-18 06:01:44
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes