Submission #2626

#TimeUsernameProblemLanguageResultExecution timeMemory
2626kipa00짝수 정렬 (tutorial3)C++98
Compilation error
0 ms0 KiB
#include <algorithm> #include <vector> #include "grader.h" using namespace std; void sort_even(int N, int *A) { vector<int> res; int i; for (i=0; i<N; ++i) { if (!(*(A + i) % 2)) res.push_back(*(A+i)); } sort(res.begin(), res.end()); for (i=0; i<res.size(); ++i) [ Report(res[i]); } }

Compilation message (stderr)

tutorial3.cpp: In function 'void sort_even(int, int*)':
tutorial3.cpp:13:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
tutorial3.cpp:14:11: error: expected ',' before '(' token
tutorial3.cpp:14:11: error: expected identifier before '(' token
tutorial3.cpp:14:19: error: expected ']' before ';' token
tutorial3.cpp: In lambda function:
tutorial3.cpp:14:19: error: expected '{' before ';' token
tutorial3.cpp: In function 'void sort_even(int, int*)':
tutorial3.cpp:14:5: error: field 'sort_even(int, int*)::<lambda()>::__Report' invalidly declared function type
tutorial3.cpp:14:19: warning: lambda expressions only available with -std=c++0x or -std=gnu++0x [enabled by default]
tutorial3.cpp: At global scope:
tutorial3.cpp:16:1: error: expected declaration before '}' token