Submission #145811

# Submission time Handle Problem Language Result Execution time Memory
145811 2019-08-21T07:04:10 Z j07801 짝수 정렬 (tutorial3) C++14
Compilation error
0 ms 0 KB
#include<stdio.h>
#include<algorithm>
using namespace std;

int sort_even(int N,*A){
	
	int cnt = 0;
	for (int i = 0; i < N; i++){
		if (A[i] % 2 == 0){
			B[cnt++] = A[i];
		}
	}
	sort(B, B + cnt); 
	for (int i = 0; i < cnt; i++){
		Report(B[i]);
	}

	return
}

Compilation message

tutorial3.cpp:5:21: error: expected identifier before '*' token
 int sort_even(int N,*A){
                     ^
tutorial3.cpp: In function 'int sort_even(int, int*)':
tutorial3.cpp:10:4: error: 'B' was not declared in this scope
    B[cnt++] = A[i];
    ^
tutorial3.cpp:13:7: error: 'B' was not declared in this scope
  sort(B, B + cnt); 
       ^
tutorial3.cpp:15:3: error: 'Report' was not declared in this scope
   Report(B[i]);
   ^~~~~~
tutorial3.cpp:15:3: note: suggested alternative: 'qsort'
   Report(B[i]);
   ^~~~~~
   qsort
tutorial3.cpp:19:1: error: expected primary-expression before '}' token
 }
 ^
tutorial3.cpp:19:1: error: expected ';' before '}' token