Submission #145762

#TimeUsernameProblemLanguageResultExecution timeMemory
145762leewj1025최댓값 (tutorial2)C++14
Compilation error
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);
}

Compilation message (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];
       ^~~