답안 #145838

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
145838 2019-08-21T07:07:30 Z lkyeon328 짝수 정렬 (tutorial3) C++14
컴파일 오류
0 ms 0 KB
#include <iostream>
#include <algorithm>
#include "grader.h"
#include <vector>
using namespace std;
int sort_even(int n, int *arr){
  vector <int> v;
    for (int i = 0; i < n; i++){
        if (arr[i] % 2 == 0);
        else v.push_back(arr[i])
    }
    sort(v.begin(), v.end());
    for (auto i : v) Refort(v[i]);
}

Compilation message

tutorial3.cpp: In function 'int sort_even(int, int*)':
tutorial3.cpp:11:5: error: expected ';' before '}' token
     }
     ^
tutorial3.cpp:13:22: error: 'Refort' was not declared in this scope
     for (auto i : v) Refort(v[i]);
                      ^~~~~~
tutorial3.cpp:13:22: note: suggested alternative: 'Report'
     for (auto i : v) Refort(v[i]);
                      ^~~~~~
                      Report
tutorial3.cpp:14:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^