Submission #14049

#TimeUsernameProblemLanguageResultExecution timeMemory
14049baji072최댓값 (tutorial2)C++98
Compilation error
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);}

Compilation message (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);}
                                                                                                          ^