Submission #19152

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

Compilation message (stderr)

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