foo.cpp: In function 'void pre_doing()':
foo.cpp:8:29: error: invalid operands of types 'int [2000]' and 'int [2000]' to binary 'operator+'
for (i=10;i<=99;i++) a[i]=a+a;
^
foo.cpp:9:45: error: invalid operands of types 'int*' and 'int [2000]' to binary 'operator+'
for (i=100;i<=999;i++) a[i]=a+a[(i%100)/10]+a;
^
foo.cpp:10:63: error: invalid operands of types 'int*' and 'int [2000]' to binary 'operator+'
for (i=1000;i<=1999;i++) a[i]=a+a[(i%1000)/100]+a[(i%100)/10]+a;
^
foo.cpp: In function 'void doit()':
foo.cpp:17:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
if (a[i]+a[j]+a==n) total++;
^