Submission #164281

# Submission time Handle Problem Language Result Execution time Memory
164281 2019-11-18T21:53:41 Z daddy0h 짝수 정렬 (tutorial3) C++11
Compilation error
0 ms 0 KB
/// https://oj.uz/problem/view/tutorial3

#include <bits/stdc++.h>

using namespace std;

void sort_even(int N, int A[])
{
    vector<int> even;
    for(int id=0; id<N; ++id)
    {
        if(A[id] % 2 == 0) even.push_back(A[id]);
    }
    sort(even.begin(), even.end());
    
    if(even.size() == 0) return;
    else 
    {
        for(int id=0; id<even.size(); ++id)
        {
            Report(even[id]); 
        }
    }
}

Compilation message

tutorial3.cpp: In function 'void sort_even(int, int*)':
tutorial3.cpp:19:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int id=0; id<even.size(); ++id)
                       ~~^~~~~~~~~~~~
tutorial3.cpp:21:13: error: 'Report' was not declared in this scope
             Report(even[id]); 
             ^~~~~~
tutorial3.cpp:21:13: note: suggested alternative: 'qsort'
             Report(even[id]); 
             ^~~~~~
             qsort