Submission #145798

# Submission time Handle Problem Language Result Execution time Memory
145798 2019-08-21T06:59:57 Z uvelo 짝수 정렬 (tutorial3) C++14
Compilation error
0 ms 0 KB
#include <stdio.h>
#include <assert.h>
#include <malloc.h>

void sort_even(int N, int *A);
static int N, *A;

int result_n;

void Report (int val){
	assert(++result_n <= N);
	printf("%d ", val);
}

int main(){
	int i, tmp;

	tmp = scanf("%d", &N);
	assert(tmp == 1);

	A = (int*) malloc( sizeof(int) * N );
	for(i = 0; i < N; i++){
		tmp = scanf("%d", &A[i]);
		assert(tmp == 1);
	}

	sort_even(N, A);

	return 0;
}

Compilation message

/tmp/cclVtoID.o: In function `Report(int)':
tutorial3.cpp:(.text+0x0): multiple definition of `Report(int)'
/tmp/ccMzBiwS.o:grader.cpp:(.text+0x0): first defined here
/tmp/cclVtoID.o:(.bss+0x0): multiple definition of `result_n'
/tmp/ccMzBiwS.o:(.bss+0x0): first defined here
/tmp/cclVtoID.o: In function `main':
tutorial3.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccMzBiwS.o:grader.cpp:(.text.startup+0x0): first defined here
/tmp/ccMzBiwS.o: In function `main':
grader.cpp:(.text.startup+0xa3): undefined reference to `sort_even(int, int*)'
/tmp/cclVtoID.o: In function `main':
tutorial3.cpp:(.text.startup+0x73): undefined reference to `sort_even(int, int*)'
collect2: error: ld returned 1 exit status