답안 #145773

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
145773 2019-08-21T06:50:02 Z lkyeon328 최댓값 (tutorial2) C++14
0 / 100
5 ms 376 KB
#include <iostream>
using namespace std;
int GetMax(int n, int *arr){
    int ans = -1;
    for (int i = 0; i < n; i++){
        ans = max(ans, arr[i]);
    }
    cout << ans;
}

Compilation message

tutorial2.cpp: In function 'int GetMax(int, int*)':
tutorial2.cpp:9:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -