제출 #14049

#제출 시각아이디문제언어결과실행 시간메모리
14049baji072최댓값 (tutorial2)C++98
컴파일 에러
0 ms0 KiB
#inclue<stdio.h> main(){int n,a[999],m=0,i=0;scanf("%d",&n);for(;i<n;i++){scanf("%d",&a[i]);m=m<a[i]?a[i]:m;}printf("%d",m);}

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

tutorial2.cpp:1:2: error: invalid preprocessing directive #inclue
 #inclue<stdio.h>
  ^
tutorial2.cpp:2:6: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
 main(){int n,a[999],m=0,i=0;scanf("%d",&n);for(;i<n;i++){scanf("%d",&a[i]);m=m<a[i]?a[i]:m;}printf("%d",m);}
      ^
tutorial2.cpp: In function ‘int main()’:
tutorial2.cpp:2:42: error: ‘scanf’ was not declared in this scope
 main(){int n,a[999],m=0,i=0;scanf("%d",&n);for(;i<n;i++){scanf("%d",&a[i]);m=m<a[i]?a[i]:m;}printf("%d",m);}
                                          ^
tutorial2.cpp:2:106: error: ‘printf’ was not declared in this scope
 main(){int n,a[999],m=0,i=0;scanf("%d",&n);for(;i<n;i++){scanf("%d",&a[i]);m=m<a[i]?a[i]:m;}printf("%d",m);}
                                                                                                          ^