/in/foo.cc: In function 'int main()':
/in/foo.cc:10:10: error: invalid types 'int[int]' for array subscript
ans[1]=1;
^
/in/foo.cc:11:10: error: invalid types 'int[int]' for array subscript
ans[2]=2;
^
/in/foo.cc:13:14: error: invalid types 'int[int]' for array subscript
ans[i]=(ans[i-1]+i-1)%mod;
^
/in/foo.cc:13:24: error: invalid types 'int[int]' for array subscript
ans[i]=(ans[i-1]+i-1)%mod;
^
/in/foo.cc:15:16: error: invalid types 'int[int]' for array subscript
cout<<ans[n]<<endl;
^
/in/foo.cc:9:17: warning: unused variable 'x' [-Wunused-variable]
int n,ans=0,x;
^