Main.cc: In function ‘int main()’:
Main.cc:22:9: error: redeclaration of ‘int n’
int n, a[n];
^
Main.cc:20:9: note: ‘int n’ previously declared here
int n;
^
Main.cc:21:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&n);
~~~~~^~~~~~~~~
Main.cc:24:8: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&a[i]);
~~~~~^~~~~~~~~~~~