답안 #244289

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
244289 2020-07-03T14:05:25 Z kimbj0709 최댓값 (tutorial2) C++14
컴파일 오류
0 ms 0 KB
int GetMax(int N, int *A){
	int ans = -INT_MAX;
	for(int i=1;i<N;i++){
		ans=max(ans,A[i]);
	}
	return ans;
}

Compilation message

tutorial2.cpp: In function 'int GetMax(int, int*)':
tutorial2.cpp:2:13: error: 'INT_MAX' was not declared in this scope
  int ans = -INT_MAX;
             ^~~~~~~
tutorial2.cpp:2:13: note: suggested alternative: '__INT_MAX__'
  int ans = -INT_MAX;
             ^~~~~~~
             __INT_MAX__
tutorial2.cpp:4:7: error: 'max' was not declared in this scope
   ans=max(ans,A[i]);
       ^~~