Submission #14082

# Submission time Handle Problem Language Result Execution time Memory
14082 2015-04-27T06:31:34 Z gs14041 최댓값 (tutorial2) C++
Compilation error
0 ms 0 KB
#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

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);
               ^