Submission #145762

# Submission time Handle Problem Language Result Execution time Memory
145762 2019-08-21T06:47:45 Z leewj1025 최댓값 (tutorial2) C++14
Compilation error
0 ms 0 KB
#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

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