Submission #1798

# Submission time Handle Problem Language Result Execution time Memory
1798 2013-07-16T12:34:38 Z caffeinism7 최댓값 (tutorial2) C++
Compilation error
0 ms 0 KB
#include <stdio.h>

int GetMax(int N, int A[]){


int main(void){
	int N, A[3000];

	scanf("%d", &N);

	for(int i = 1; i <= N; i ++){
		scanf("%d", &A[i]);
	}

	printf("%d", GetMax(N, A));

	return 0;
}
  
  	int max = 0;

	for(int i=1; i<=N; i++){
		if(max < A[i]){
			max = A[i];
		}
	}

	return max;
}

Compilation message

tutorial2.cpp: In function 'int GetMax(int, int*)':
tutorial2.cpp:6:15: error: a function-definition is not allowed here before '{' token
tutorial2.cpp:29:1: error: expected '}' at end of input
tutorial2.cpp:29:1: warning: no return statement in function returning non-void [-Wreturn-type]