Submission #145823

# Submission time Handle Problem Language Result Execution time Memory
145823 2019-08-21T07:05:29 Z leewj1025 짝수 정렬 (tutorial3) C++14
Compilation error
0 ms 0 KB
#include <stdio.h>
#include <assert.h>
#include <malloc.h>
int result_n;
static int N, *A;
void Report (int val){
	assert(++result_n <= N);
	printf("%d ", val);
}
void sort_even(int N, int *A) {
	int i;
	for (i = 0; i < N; i++) {
		if (A[i] % 2 == 0) Report(A[i]);
	}
}




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/ccQlUaYT.o: In function `Report(int)':
tutorial3.cpp:(.text+0x0): multiple definition of `Report(int)'
/tmp/ccWuULvH.o:grader.cpp:(.text+0x0): first defined here
/tmp/ccQlUaYT.o:(.bss+0x0): multiple definition of `result_n'
/tmp/ccWuULvH.o:(.bss+0x0): first defined here
/tmp/ccQlUaYT.o: In function `main':
tutorial3.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccWuULvH.o:grader.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status