Language: C

typedef struct{int r,i;}C;char*p,s[999];o;C E(),M(),a;C G(r,i){C c={r,i};o|=abs(r)>1e4||abs(i)>1e4;return c;}C T(r,l){C c;*p==40?c=E(p++),p++:*p<58?sscanf(p,"%d%n",&r,&l),p+=l,c=G(r,0):(c=G(0,1),p++);return c;}C E(f){C c=M(),d;for(f=1;f;)f=*p==43?d=M(p++),c=G(c.r+d.r,c.i+d.i),1:*p==45?d=M(p++),c=G(c.r-d.r,c.i-d.i),1:0;return c;}C M(f){C c=T(),d;for(f=1;f;)f=*p==42?d=T(p++),c=G(c.r*d.r-c.i*d.i,c.r*d.i+c.i*d.r),1:0;return c;}main(){for(;~scanf("%s",p=s);o?o=!puts("overflow"):a.i?a.r?printf("%d%+di\n",a.r,a.i):printf("%di\n",a.i):printf("%d\n",a.r))a=E();}

Compiler output:
main.c:1:41: warning: data definition has no type or storage class
    1 | typedef struct{int r,i;}C;char*p,s[999];o;C E(),M(),a;C G(r,i){C c={r,i};o|=abs(r)>1e4||abs(i)>1e4;return c;}C T(r,l){C c;*p==40?c=E(p++),p++:*p<58?sscanf(p,"%d%n",&r,&l),p+=l,c=G(r,0):(c=G(0,1),p++);return c;}C E(f){C c=M(),d;for(f=1;f;)f=*p==43?d=M(p++),c=G(c.r+d.r,c.i+d.i),1:*p==45?d=M(p++),c=G(c.r-d.r,c.i-d.i),1:0;return c;}C M(f){C c=T(),d;for(f=1;f;)f=*p==42?d=T(p++),c=G(c.r*d.r-c.i*d.i,c.r*d.i+c.i*d.r),1:0;return c;}main(){for(;~scanf("%s",p=s);o?o=!puts("overflow"):a.i?a.r?printf("%d%+di\n",a.r,a.i):printf("%di\n",a.i):printf("%d\n",a.r))a=E();}
      |                                         ^
main.c:1:41: error: type defaults to 'int' in declaration of 'o' [-Wimplicit-int]
main.c: In function 'G':
main.c:1:57: error: type of 'r' defaults to 'int' [-Wimplicit-int]
    1 | typedef struct{int r,i;}C;char*p,s[999];o;C E(),M(),a;C G(r,i){C c={r,i};o|=abs(r)>1e4||abs(i)>1e4;return c;}C T(r,l){C c;*p==40?c=E(p++),p++:*p<58?sscanf(p,"%d%n",&r,&l),p+=l,c=G(r,0):(c=G(0,1),p++);return c;}C E(f){C c=M(),d;for(f=1;f;)f=*p==43?d=M(p++),c=G(c.r+d.r,c.i+d.i),1:*p==45?d=M(p++),c=G(c.r-d.r,c.i-d.i),1:0;return c;}C M(f){C c=T(),d;for(f=1;f;)f=*p==42?d=T(p++),c=G(c.r*d.r-c.i*d.i,c.r*d.i+c.i*d.r),1:0;return c;}main(){for(;~scanf("%s",p=s);o?o=!puts("overflow"):a.i?a.r?printf("%d%+di\n",a.r,a.i):printf("%di\n",a.i):printf("%d\n",a.r))a=E();}
      |                                                         ^
main.c:1:57: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:1:77: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
    1 | typedef struct{int r,i;}C;char*p,s[999];o;C E(),M(),a;C G(r,i){C c={r,i};o|=abs(r)>1e4||abs(i)>1e4;return c;}C T(r,l){C c;*p==40?c=E(p++),p++:*p<58?sscanf(p,"%d%n",&r,&l),p+=l,c=G(r,0):(c=G(0,1),p++);return c;}C E(f){C c=M(),d;for(f=1;f;)f=*p==43?d=M(p++),c=G(c.r+d.r,c.i+d.i),1:*p==45?d=M(p++),c=G(c.r-d.r,c.i-d.i),1:0;return c;}C M(f){C c=T(),d;for(f=1;f;)f=*p==42?d=T(p++),c=G(c.r*d.r-c.i*d.i,c.r*d.i+c.i*d.r),1:0;return c;}main(){for(;~scanf("%s",p=s);o?o=!puts("overflow"):a.i?a.r?printf("%d%+di\n",a.r,a.i):printf("%di\n",a.i):printf("%d\n",a.r))a=E();}
      |                                                                             ^~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
  +++ |+#include <stdlib.h>
    1 | typedef struct{int r,i;}C;char*p,s[999];o;C E(),M(),a;C G(r,i){C c={r,i};o|=abs(r)>1e4||abs(i)>1e4;return c;}C T(r,l){C c;*p==40?c=E(p++),p++:*p<58?sscanf(p,"%d%n",&r,&l),p+=l,c=G(r,0):(c=G(0,1),p++);return c;}C E(f){C c=M(),d;for(f=1;f;)f=*p==43?d=M(p++),c=G(c.r+d.r,c.i+d.i),1:*p==45?d=M(p++),c=G(c.r-d.r,c.i-d.i),1:0;return c;}C M(f){C c=T(),d;for(f=1;f;)f=*p==42?d=T(p++),c=G(c.r*d.r-c.i*d.i,c.r*d.i+c.i*d.r),1:0;return c;}main(){for(;~scanf("%s",p=s);o?o=!puts("overflow"):a.i?a.r?printf("%d%+di\n",a.r,a.i):printf("%di\n",a.i):printf("%d\n",a.r))a=E();}
main.c: In function 'T':
main.c:1:112: error: type of 'r' defaults to 'int' [-Wimplicit-int]
    1 | typedef struct{int r,i;}C;char*p,s[999];o;C E(),M(),a;C G(r,i){C c={r,i};o|=abs(r)>1e4||abs(i)>1e4;return c;}C T(r,l){C c;*p==40?c=E(p++),p++:*p<58?sscanf(p,"%d%n",&r,&l),p+=l,c=G(r,0):(c=G(0,1),p++);return c;}C E(f){C c=M(),d;for(f=1;f;)f=*p==43?d=M(p++),c=G(c.r+d.r,c.i+d.i),1:*p==45?d=M(p++),c=G(c.r-d.r,c.i-d.i),1:0;return c;}C M(f){C c=T(),d;for(f=1;f;)f=*p==42?d=T(p++),c=G(c.r*d.r-c.i*d.i,c.r*d.i+c.i*d.r),1:0;return c;}main(){for(;~scanf("%s",p=s);o?o=!puts("overflow"):a.i?a.r?printf("%d%+di\n",a.r,a.i):printf("%di\n",a.i):printf("%d\n",a.r))a=E();}
      |                                                                                                                ^
main.c:1:112: error: type of 'l' defaults to 'int' [-Wimplicit-int]
main.c:1:149: error: implicit declaration of function 'sscanf' [-Wimplicit-function-declaration]
    1 | typedef struct{int r,i;}C;char*p,s[999];o;C E(),M(),a;C G(r,i){C c={r,i};o|=abs(r)>1e4||abs(i)>1e4;return c;}C T(r,l){C c;*p==40?c=E(p++),p++:*p<58?sscanf(p,"%d%n",&r,&l),p+=l,c=G(r,0):(c=G(0,1),p++);return c;}C E(f){C c=M(),d;for(f=1;f;)f=*p==43?d=M(p++),c=G(c.r+d.r,c.i+d.i),1:*p==45?d=M(p++),c=G(c.r-d.r,c.i-d.i),1:0;return c;}C M(f){C c=T(),d;for(f=1;f;)f=*p==42?d=T(p++),c=G(c.r*d.r-c.i*d.i,c.r*d.i+c.i*d.r),1:0;return c;}main(){for(;~scanf("%s",p=s);o?o=!puts("overflow"):a.i?a.r?printf("%d%+di\n",a.r,a.i):printf("%di\n",a.i):printf("%d\n",a.r))a=E();}
      |                                                                                                                                                     ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'sscanf'
  +++ |+#include <stdio.h>
    1 | typedef struct{int r,i;}C;char*p,s[999];o;C E(),M(),a;C G(r,i){C c={r,i};o|=abs(r)>1e4||abs(i)>1e4;return c;}C T(r,l){C c;*p==40?c=E(p++),p++:*p<58?sscanf(p,"%d%n",&r,&l),p+=l,c=G(r,0):(c=G(0,1),p++);return c;}C E(f){C c=M(),d;for(f=1;f;)f=*p==43?d=M(p++),c=G(c.r+d.r,c.i+d.i),1:*p==45?d=M(p++),c=G(c.r-d.r,c.i-d.i),1:0;return c;}C M(f){C c=T(),d;for(f=1;f;)f=*p==42?d=T(p++),c=G(c.r*d.r-c.i*d.i,c.r*d.i+c.i*d.r),1:0;return c;}main(){for(;~scanf("%s",p=s);o?o=!puts("overflow"):a.i?a.r?printf("%d%+di\n",a.r,a.i):printf("%di\n",a.i):printf("%d\n",a.r))a=E();}
main.c:1:149: warning: incompatible implicit declaration of built-in function 'sscanf' [-Wbuiltin-declaration-mismatch]
    1 | typedef struct{int r,i;}C;char*p,s[999];o;C E(),M(),a;C G(r,i){C c={r,i};o|=abs(r)>1e4||abs(i)>1e4;return c;}C T(r,l){C c;*p==40?c=E(p++),p++:*p<58?sscanf(p,"%d%n",&r,&l),p+=l,c=G(r,0):(c=G(0,1),p++);return c;}C E(f){C c=M(),d;for(f=1;f;)f=*p==43?d=M(p++),c=G(c.r+d.r,c.i+d.i),1:*p==45?d=M(p++),c=G(c.r-d.r,c.i-d.i),1:0;return c;}C M(f){C c=T(),d;for(f=1;f;)f=*p==42?d=T(p++),c=G(c.r*d.r-c.i*d.i,c.r*d.i+c.i*d.r),1:0;return c;}main(){for(;~scanf("%s",p=s);o?o=!puts("overflow"):a.i?a.r?printf("%d%+di\n",a.r,a.i):printf("%di\n",a.i):printf("%d\n",a.r))a=E();}
      |                                                                                                                                                     ^~~~~~
main.c:1:149: note: include '<stdio.h>' or provide a declaration of 'sscanf'
main.c:1:185: error: type mismatch in conditional expression
    1 | typedef struct{int r,i;}C;char*p,s[999];o;C E(),M(),a;C G(r,i){C c={r,i};o|=abs(r)>1e4||abs(i)>1e4;return c;}C T(r,l){C c;*p==40?c=E(p++),p++:*p<58?sscanf(p,"%d%n",&r,&l),p+=l,c=G(r,0):(c=G(0,1),p++);return c;}C E(f){C c=M(),d;for(f=1;f;)f=*p==43?d=M(p++),c=G(c.r+d.r,c.i+d.i),1:*p==45?d=M(p++),c=G(c.r-d.r,c.i-d.i),1:0;return c;}C M(f){C c=T(),d;for(f=1;f;)f=*p==42?d=T(p++),c=G(c.r*d.r-c.i*d.i,c.r*d.i+c.i*d.r),1:0;return c;}main(){for(;~scanf("%s",p=s);o?o=!puts("overflow"):a.i?a.r?printf("%d%+di\n",a.r,a.i):printf("%di\n",a.i):printf("%d\n",a.r))a=E();}
      |                                                                                                                                                                                         ^
main.c: In function 'E':
main.c:1:213: error: type of 'f' defaults to 'int' [-Wimplicit-int]
    1 | typedef struct{int r,i;}C;char*p,s[999];o;C E(),M(),a;C G(r,i){C c={r,i};o|=abs(r)>1e4||abs(i)>1e4;return c;}C T(r,l){C c;*p==40?c=E(p++),p++:*p<58?sscanf(p,"%d%n",&r,&l),p+=l,c=G(r,0):(c=G(0,1),p++);return c;}C E(f){C c=M(),d;for(f=1;f;)f=*p==43?d=M(p++),c=G(c.r+d.r,c.i+d.i),1:*p==45?d=M(p++),c=G(c.r-d.r,c.i-d.i),1:0;return c;}C M(f){C c=T(),d;for(f=1;f;)f=*p==42?d=T(p++),c=G(c.r*d.r-c.i*d.i,c.r*d.i+c.i*d.r),1:0;return c;}main(){for(;~scanf("%s",p=s);o?o=!puts("overflow"):a.i?a.r?printf("%d%+di\n",a.r,a.i):printf("%di\n",a.i):printf("%d\n",a.r))a=E();}
      |                                                                                                                                                                                                                     ^
main.c: In function 'M':
main.c:1:333: error: type of 'f' defaults to 'int' [-Wimplicit-int]
    1 | typedef struct{int r,i;}C;char*p,s[999];o;C E(),M(),a;C G(r,i){C c={r,i};o|=abs(r)>1e4||abs(i)>1e4;return c;}C T(r,l){C c;*p==40?c=E(p++),p++:*p<58?sscanf(p,"%d%n",&r,&l),p+=l,c=G(r,0):(c=G(0,1),p++);return c;}C E(f){C c=M(),d;for(f=1;f;)f=*p==43?d=M(p++),c=G(c.r+d.r,c.i+d.i),1:*p==45?d=M(p++),c=G(c.r-d.r,c.i-d.i),1:0;return c;}C M(f){C c=T(),d;for(f=1;f;)f=*p==42?d=T(p++),c=G(c.r*d.r-c.i*d.i,c.r*d.i+c.i*d.r),1:0;return c;}main(){for(;~scanf("%s",p=s);o?o=!puts("overflow"):a.i?a.r?printf("%d%+di\n",a.r,a.i):printf("%di\n",a.i):printf("%d\n",a.r))a=E();}
      |                                                                                                                                                                                                                                                                                                                                             ^
main.c: At top level:
main.c:1:428: error: return type defaults to 'int' [-Wimplicit-int]
    1 | typedef struct{int r,i;}C;char*p,s[999];o;C E(),M(),a;C G(r,i){C c={r,i};o|=abs(r)>1e4||abs(i)>1e4;return c;}C T(r,l){C c;*p==40?c=E(p++),p++:*p<58?sscanf(p,"%d%n",&r,&l),p+=l,c=G(r,0):(c=G(0,1),p++);return c;}C E(f){C c=M(),d;for(f=1;f;)f=*p==43?d=M(p++),c=G(c.r+d.r,c.i+d.i),1:*p==45?d=M(p++),c=G(c.r-d.r,c.i-d.i),1:0;return c;}C M(f){C c=T(),d;for(f=1;f;)f=*p==42?d=T(p++),c=G(c.r*d.r-c.i*d.i,c.r*d.i+c.i*d.r),1:0;return c;}main(){for(;~scanf("%s",p=s);o?o=!puts("overflow"):a.i?a.r?printf("%d%+di\n",a.r,a.i):printf("%di\n",a.i):printf("%d\n",a.r))a=E();}
      |                                                                                                                                                                                                                                                                                                                                                                                                                                            ^~~~
main.c: In function 'main':
main.c:1:441: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | typedef struct{int r,i;}C;char*p,s[999];o;C E(),