Submission #119565

# Submission time Handle Problem Language Result Execution time Memory
119565 2019-06-21T11:47:29 Z Diuven 최댓값 (tutorial2) C++14
Compilation error
0 ms 0 KB
int GetMax(int n, int A[]){
  int mx = -1e9;
  for(int i=0; i<n; i++) mx = max(mx, A[i]);
  return mx;
}

Compilation message

tutorial2.cpp: In function 'int GetMax(int, int*)':
tutorial2.cpp:3:31: error: 'max' was not declared in this scope
   for(int i=0; i<n; i++) mx = max(mx, A[i]);
                               ^~~
tutorial2.cpp:3:31: note: suggested alternative: 'mx'
   for(int i=0; i<n; i++) mx = max(mx, A[i]);
                               ^~~
                               mx