Submission #14487

# Submission time Handle Problem Language Result Execution time Memory
14487 2015-05-17T14:16:15 Z nosiar 짝수 정렬 (tutorial3) C++
Compilation error
0 ms 0 KB
#include <algorithm>
#include <vector>
int sort_even(int N, int *A)
{
    std::vector<int> x;
    for (int i = 0; i < N; ++i) if (A[i] % 2 == 0) x.push_back(A[i]);
    std::sort(x.begin(), x.end());
    for (int i : x) Report(i);
}

Compilation message

tutorial3.cpp: In function ‘int sort_even(int, int*)’:
tutorial3.cpp:8:18: error: range-based ‘for’ loops are not allowed in C++98 mode
     for (int i : x) Report(i);
                  ^
tutorial3.cpp:8:29: error: ‘Report’ was not declared in this scope
     for (int i : x) Report(i);
                             ^
tutorial3.cpp:9:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^