답안 #145807

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
145807 2019-08-21T07:02:44 Z wesley2003 짝수 정렬 (tutorial3) C++14
컴파일 오류
0 ms 0 KB
#include <stdio.h>
#include <assert.h>
#include <malloc.h>
#include <algorithm>
using namespace std;
int GetMax(int N,int *A){
	int arr[20]={0,},cnt=0;
	for(int i=0;i<N;i++){
		if(A[i]%2==0){
			arr[cnt]=A[i];
			cnt++;	
		} 
	}
  for(int i=0;i<cnt;i++){
    report(arr[i]);
  }
}

Compilation message

tutorial3.cpp: In function 'int GetMax(int, int*)':
tutorial3.cpp:15:5: error: 'report' was not declared in this scope
     report(arr[i]);
     ^~~~~~
tutorial3.cpp:15:5: note: suggested alternative: 'qsort'
     report(arr[i]);
     ^~~~~~
     qsort
tutorial3.cpp:17:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^