Submission #14082

#TimeUsernameProblemLanguageResultExecution timeMemory
14082gs14041최댓값 (tutorial2)C++98
Compilation error
0 ms0 KiB
#include<stdio.h> int main() { int i,ans=0,a; for(i=1;i<=n;i++) { scanf("%d",&a); if(a>ans) ans=a; } printf("%d",ans); }

Compilation message (stderr)

tutorial2.cpp: In function ‘int main()’:
tutorial2.cpp:5:12: error: ‘n’ was not declared in this scope
 for(i=1;i<=n;i++)
            ^
tutorial2.cpp:7:15: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
 scanf("%d",&a);
               ^