Submission #2625

#TimeUsernameProblemLanguageResultExecution timeMemory
2625kipa00짝수 정렬 (tutorial3)C++98
Compilation error
0 ms0 KiB
#include <algorithm> #include <vector> #include "grader.h" 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:6:3: error: 'vector' was not declared in this scope
tutorial3.cpp:6:3: note: suggested alternative:
/usr/include/c++/4.6/bits/stl_vector.h:180:11: note:   'std::vector'
tutorial3.cpp:6:10: error: expected primary-expression before 'int'
tutorial3.cpp:6:10: error: expected ';' before 'int'
tutorial3.cpp:9:26: error: 'res' was not declared in this scope
tutorial3.cpp:11:8: error: 'res' was not declared in this scope
tutorial3.cpp:11:30: error: 'sort' was not declared in this scope
tutorial3.cpp:11:30: note: suggested alternative:
/usr/include/c++/4.6/bits/stl_algo.h:5430:5: note:   'std::sort'
tutorial3.cpp:13:11: error: expected ',' before '(' token
tutorial3.cpp:13:11: error: expected identifier before '(' token
tutorial3.cpp:13:19: error: expected ']' before ';' token
tutorial3.cpp: In lambda function:
tutorial3.cpp:13:19: error: expected '{' before ';' token
tutorial3.cpp: In function 'void sort_even(int, int*)':
tutorial3.cpp:13:5: error: field 'sort_even(int, int*)::<lambda()>::__Report' invalidly declared function type
tutorial3.cpp:13:19: warning: lambda expressions only available with -std=c++0x or -std=gnu++0x [enabled by default]
tutorial3.cpp: At global scope:
tutorial3.cpp:15:1: error: expected declaration before '}' token