Test Cases Failing

Hi I am trying a very simple code but still test cases are failing. So is there a way to check the input due to which the test cases are failing?
Here is my program-
#include
using namespace std ;
int main(){
long int n;
cin>>n;
long int a[n] ;
long int max =0;
for(long int i=0;i<n;i++){
//cout<<a[i];
if(max>a[i])
{
max = a[i] ;

}

}
cout<<max ;
return 0;
}

It’s in the challenges section. Challenge Name is Arrays-Max Value In Array.

  1. You forgot to take the input of numbers .
    2.You need to update the max when you find any element greater than it.
    i.e max<a[i]
    then
    max=a[i];
  2. You need to initialise max with INT_MIN instead of zero as elements of array can be negative and zero is greater than negative numbers ,so in that case where every element is negative it will give ans=0 but you want the maximum out of negative elements.

Refer this I have corrected your code:https://ide.codingblocks.com/s/43917