Submission #525232

# Submission time Handle Problem Language Result Execution time Memory
525232 2022-02-11T07:18:05 Z pokmui9909 짝수 정렬 (tutorial3) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int sort_even(int N, int *A){
    vector<ll> V;
    for(int i = 0; i < N; i++){
        if(A[i] % 2 == 0){
            V.push_back(A[i]);
        }
    }
    sort(V.begin(), V.end());
    for(int i = 0; i < V.size(); i++){
        Report(V[i]);
    }
}

Compilation message

tutorial3.cpp: In function 'int sort_even(int, int*)':
tutorial3.cpp:13:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     for(int i = 0; i < V.size(); i++){
      |                    ~~^~~~~~~~~~
tutorial3.cpp:14:9: error: 'Report' was not declared in this scope
   14 |         Report(V[i]);
      |         ^~~~~~
tutorial3.cpp:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
   16 | }
      | ^