답안 #525231

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
525231 2022-02-11T07:17:31 Z pokmui9909 짝수 정렬 (tutorial3) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int GetMax(int N, int *A){
    vector<ll> V;
    for(int i = 0; i < N; i++){
        if(A[i] % 2 == 0){
            V.push_back(A[i]);
        }
    }
    sort(V.begin(), V.end());
    for(int i = 0; i < V.size(); i++){
        Report(V[i]);
    }
}

Compilation message

tutorial3.cpp: In function 'int GetMax(int, int*)':
tutorial3.cpp:13:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     for(int i = 0; i < V.size(); i++){
      |                    ~~^~~~~~~~~~
tutorial3.cpp:14:9: error: 'Report' was not declared in this scope
   14 |         Report(V[i]);
      |         ^~~~~~
tutorial3.cpp:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
   16 | }
      | ^