Submission #18791

# Submission time Handle Problem Language Result Execution time Memory
18791 2016-02-15T12:23:22 Z pjh0123 최댓값 (tutorial2) C++
Compilation error
0 ms 0 KB
int GetMax(int N,int *A){
  int mx=0;
  for(i=0;i<N;i++)mx=mx<A[i]?A[i]:mx;
  return mx;
}

Compilation message

tutorial2.cpp: In function ‘int GetMax(int, int*)’:
tutorial2.cpp:3:7: error: ‘i’ was not declared in this scope
   for(i=0;i<N;i++)mx=mx<A[i]?A[i]:mx;
       ^