Submission #2626

# Submission time Handle Problem Language Result Execution time Memory
2626 2013-07-28T06:24:49 Z kipa00 짝수 정렬 (tutorial3) C++
Compilation error
0 ms 0 KB
#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

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