Submission #14487

#TimeUsernameProblemLanguageResultExecution timeMemory
14487nosiar짝수 정렬 (tutorial3)C++98
Compilation error
0 ms0 KiB
#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 (stderr)

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]
 }
 ^