# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
145823 | 2019-08-21T07:05:29 Z | leewj1025 | 짝수 정렬 (tutorial3) | C++14 | 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; }