Main.cc: In function ‘int main()’:
Main.cc:18:8: error: ‘i’ was not declared in this scope
if(a[i]>0) j++;
^
Main.cc:20:6: error: ‘i’ was not declared in this scope
a[i]--;
^
Main.cc:24:3: error: ‘i’ was not declared in this scope
i++;
^