Submission #145817

# Submission time Handle Problem Language Result Execution time Memory
145817 2019-08-21T07:04:49 Z hahorse 짝수 정렬 (tutorial3) C++14
Compilation error
0 ms 0 KB
#include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;
int sort_even(int n, int *a){
	vector <int > v;
	for(int i=0;i<n;i++){
      if(a[i]%2==0){
        v.push_back(a[i]);
      }
    }
  sort(v.begin(),v.end();
	for(auto it:v){
      Report(it);
    }
}

Compilation message

tutorial3.cpp: In function 'int sort_even(int, int*)':
tutorial3.cpp:12:25: error: expected ')' before ';' token
   sort(v.begin(),v.end();
                         ^
tutorial3.cpp:14:7: error: 'Report' was not declared in this scope
       Report(it);
       ^~~~~~
tutorial3.cpp:14:7: note: suggested alternative: 'qsort'
       Report(it);
       ^~~~~~
       qsort
tutorial3.cpp:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^