Language: C

#define zero(n)(fabs(n)<.01)
main(n,a,b,c,d,p,q,r,D,f){
	for(scanf("%d",&n);n;n--){
		scanf("%d%d%d%d",&a,&b,&c,&d);//fx=ax3+bx2+cx+d
		if(a<0)a=-a,b=-b,c=-c,d=-d;   //won't lose generality
		p=3*a,q=2*b,r=c,D=q*q-4*p*r;  //f'x=3ax2+2bx+c D: f'x=0?
		if(D>0){
			double x1=(-q-sqrt(D))/p/2,x2=(-q+sqrt(D))/p/2;
			double y1=a*x1*x1*x1+b*x1*x1+c*x1+d;
			double y2=a*x2*x2*x2+b*x2*x2+c*x2+d;
			if(!zero(y1)&&!zero(y2)>E&&y1*y2>0)goto one;
			puts(
				zero(x1)?(
					d==0?"1 0":
					"2 1"
				):zero(x2)?(
					d==0?"0 1":
					"1 2"
				):x1>0?(
					d>0?"2 1":
					d<0?"3 0":
					"2 0"
				):x2<0?(
					d>0?"0 3":
					d<0?"1 2":
					"0 2"
				):(
					d>0?"2 1":
					d<0?"1 2":
					"1 1"
				)
			);
		}else if(D==0)puts(
			d>0?"0 1":
			d<0?"1 0":
			"0 0"
		);else{one:
			puts(d>0?"0 1":d<0?"1 0":"0 0");
		}
	}
	exit(0);
}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(n,a,b,c,d,p,q,r,D,f){
      | ^~~~
main.c: In function 'main':
main.c:2:1: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'd' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'p' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'q' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'r' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'D' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'f' defaults to 'int' [-Wimplicit-int]
main.c:3:13: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |         for(scanf("%d",&n);n;n--){
      |             ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #define zero(n)(fabs(n)<.01)
main.c:3:13: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |         for(scanf("%d",&n);n;n--){
      |             ^~~~~
main.c:3:13: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:8:39: error: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
    8 |                         double x1=(-q-sqrt(D))/p/2,x2=(-q+sqrt(D))/p/2;
      |                                       ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt'
  +++ |+#include <math.h>
    1 | #define zero(n)(fabs(n)<.01)
main.c:8:39: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
    8 |                         double x1=(-q-sqrt(D))/p/2,x2=(-q+sqrt(D))/p/2;
      |                                       ^~~~
main.c:8:39: note: include '<math.h>' or provide a declaration of 'sqrt'
main.c:1:17: error: implicit declaration of function 'fabs' [-Wimplicit-function-declaration]
    1 | #define zero(n)(fabs(n)<.01)
      |                 ^~~~
main.c:11:29: note: in expansion of macro 'zero'
   11 |                         if(!zero(y1)&&!zero(y2)>E&&y1*y2>0)goto one;
      |                             ^~~~
main.c:1:17: note: include '<math.h>' or provide a declaration of 'fabs'
    1 | #define zero(n)(fabs(n)<.01)
      |                 ^~~~
main.c:11:29: note: in expansion of macro 'zero'
   11 |                         if(!zero(y1)&&!zero(y2)>E&&y1*y2>0)goto one;
      |                             ^~~~
main.c:1:17: warning: incompatible implicit declaration of built-in function 'fabs' [-Wbuiltin-declaration-mismatch]
    1 | #define zero(n)(fabs(n)<.01)
      |                 ^~~~
main.c:11:29: note: in expansion of macro 'zero'
   11 |                         if(!zero(y1)&&!zero(y2)>E&&y1*y2>0)goto one;
      |                             ^~~~
main.c:1:17: note: include '<math.h>' or provide a declaration of 'fabs'
    1 | #define zero(n)(fabs(n)<.01)
      |                 ^~~~
main.c:11:29: note: in expansion of macro 'zero'
   11 |                         if(!zero(y1)&&!zero(y2)>E&&y1*y2>0)goto one;
      |                             ^~~~
main.c:11:49: error: 'E' undeclared (first use in this function)
   11 |                         if(!zero(y1)&&!zero(y2)>E&&y1*y2>0)goto one;
      |                                                 ^
main.c:11:49: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:25: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
   12 |                         puts(
      |                         ^~~~
main.c:12:25: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:1:17: warning: incompatible implicit declaration of built-in function 'fabs' [-Wbuiltin-declaration-mismatch]
    1 | #define zero(n)(fabs(n)<.01)
      |                 ^~~~
main.c:13:33: note: in expansion of macro 'zero'
   13 |                                 zero(x1)?(
      |                                 ^~~~
main.c:1:17: note: include '<math.h>' or provide a declaration of 'fabs'
    1 | #define zero(n)(fabs(n)<.01)
      |                 ^~~~
main.c:13:33: note: in expansion of macro 'zero'
   13 |                                 zero(x1)?(
      |                                 ^~~~
main.c:41:9: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
   41 |         exit(0);
      |         ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | #define zero(n)(fabs(n)<.01)
main.c:41:9: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   41 |         exit(0);
      |         ^~~~
main.c:41:9: note: include '<stdlib.h>' or provide a declaration of 'exit'