제출 #145762

#제출 시각아이디문제언어결과실행 시간메모리
145762leewj1025최댓값 (tutorial2)C++14
컴파일 에러
0 ms0 KiB
#include<stdio.h>

int main(){
  int n;
  int max=0;
  int arr[1000];
  for(int i=0;i<n;i++){
    scanf("%d",&a[i]);
    if(max<a[i])
      max=a[i];
  }
  printf("%d",max);
}

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

tutorial2.cpp: In function 'int main()':
tutorial2.cpp:8:17: error: 'a' was not declared in this scope
     scanf("%d",&a[i]);
                 ^
tutorial2.cpp:6:7: warning: unused variable 'arr' [-Wunused-variable]
   int arr[1000];
       ^~~