Main.cc: In function ‘int main()’:
Main.cc:7:9: error: ‘flag’ was not declared in this scope
if (flag == 0) {
^~~~
Main.cc:7:9: note: suggested alternative: ‘float’
if (flag == 0) {
^~~~
float
Main.cc:4:12: warning: unused variable ‘a’ [-Wunused-variable]
int n, a[100];
^
Main.cc:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
~~~~~^~~~~~~~~~