제출 #14082

#제출 시각아이디문제언어결과실행 시간메모리
14082gs14041최댓값 (tutorial2)C++98
컴파일 에러
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);
}

컴파일 시 표준 에러 (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);
               ^