foo.cpp: In function 'int main()':
foo.cpp:7:20: error: 'scanf' was not declared in this scope
scanf("%d",&num);
^
foo.cpp:14:36: error: 'printf' was not declared in this scope
if(arr[i]>0) printf("+");
^
foo.cpp:16:32: error: 'printf' was not declared in this scope
if(arr[i]<0) printf("-");
^
foo.cpp:17:22: error: 'abs' was not declared in this scope
if(abs(arr[i])!=1 || i==0) printf("%d",abs(arr[i]));
^
foo.cpp:17:22: note: suggested alternative:
In file included from foo.cpp:2:0:
c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\cmath:99:5: note: 'std::abs'
abs(_Tp __x)
^
foo.cpp:17:59: error: 'printf' was not declared in this scope
if(abs(arr[i])!=1 || i==0) printf("%d",abs(arr[i]));
^
foo.cpp:19:23: error: 'printf' was not declared in this scope
printf("x");
^
foo.cpp:23:16: error: 'printf' was not declared in this scope
printf("\n");
^