Submission #18791

#TimeUsernameProblemLanguageResultExecution timeMemory
18791pjh0123최댓값 (tutorial2)C++98
Compilation error
0 ms0 KiB
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 (stderr)

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;
       ^