Submission #145765

# Submission time Handle Problem Language Result Execution time Memory
145765 2019-08-21T06:48:57 Z xxxxorb0221 최댓값 (tutorial2) C++14
Compilation error
0 ms 0 KB
#include<algorithm>
using namespace std;
int Getmax(int n,int arr*){
  int ans=arr[0];
  for(int i=0;i<n;i++)
    ans=max(ans,arr[i]);
  return ans;
}

Compilation message

tutorial2.cpp:3:25: error: expected ',' or '...' before '*' token
 int Getmax(int n,int arr*){
                         ^
tutorial2.cpp: In function 'int Getmax(int, int)':
tutorial2.cpp:4:16: error: invalid types 'int[int]' for array subscript
   int ans=arr[0];
                ^
tutorial2.cpp:6:22: error: invalid types 'int[int]' for array subscript
     ans=max(ans,arr[i]);
                      ^