Submission #19194

#TimeUsernameProblemLanguageResultExecution timeMemory
19194anrhks1212최댓값 (tutorial2)C++98
Compilation error
0 ms0 KiB
#include <iostream> using namespace std; int GetMax(int N, int *A); int main() { int N; cin >> N; int *A = new int[N - 1]; cout<<GetMax(N, A); return 0; } int GetMax(int N, int *A) { int i=0, max=0; for (i = 0; i<N; i++) { cin >> A[i]; } max = A[0]; for (i = 0; i < N - 1; i++) { if (max < A[i + 1]) { max = A[i + 1]; } } return max; }

Compilation message (stderr)

/tmp/ccADQgHY.o: In function `main':
tutorial2.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccmL7fle.o:grader.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status