제출 #513

#제출 시각아이디문제언어결과실행 시간메모리
513jwvg0425최댓값 (tutorial2)C++98
컴파일 에러
0 ms0 KiB
#include <stdio.h> int GetMax(N, A) { int i,m=A[0]; for(i=1;i<N;i++) { if(A[i]>m)m=A[i]; } return m; } int main() { int n,a[10],i; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&a[i]); } printf("%d",GetMax(n,a)); }

컴파일 시 표준 에러 (stderr) 메시지

tutorial2.cpp:2:12: error: 'N' was not declared in this scope
tutorial2.cpp:2:15: error: 'A' was not declared in this scope
tutorial2.cpp:2:16: error: expression list treated as compound expression in initializer [-fpermissive]
tutorial2.cpp:3:1: error: expected ',' or ';' before '{' token