Language: C


main(N,R,M,m,y,n,t,c,i,d){double r;
	for(scanf("%d",&N);N--;printf("%d\n",R)){
		for(scanf("%d%d%d",&M,&y,&n),R=M;n--;R=m>R?m:R){
			if(m=M,d=0,scanf("%d%lf%d",&t,&r,&c),t){ //fukuri
				for(i=0;i<y;i++){
					dm=(int)floor(r*m);
					m=m+dm-c;
				}
			}else{ //tanri
				for(i=0;i<y;i++){
					dm+=(int)floor(r*m);
					m=m-c;
				}
				m+=dm;
			}
		}
	}
exit(0);}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(N,R,M,m,y,n,t,c,i,d){double r;
      | ^~~~
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 'R' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'M' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'm' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'y' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 't' 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 'i' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'd' defaults to 'int' [-Wimplicit-int]
main.c:3:13: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |         for(scanf("%d",&N);N--;printf("%d\n",R)){
      |             ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | 
main.c:3:13: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |         for(scanf("%d",&N);N--;printf("%d\n",R)){
      |             ^~~~~
main.c:3:13: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:3:32: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    3 |         for(scanf("%d",&N);N--;printf("%d\n",R)){
      |                                ^~~~~~
main.c:3:32: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:3:32: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:3:32: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:7:41: error: 'dm' undeclared (first use in this function); did you mean 'd'?
    7 |                                         dm=(int)floor(r*m);
      |                                         ^~
      |                                         d
main.c:7:41: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:49: error: implicit declaration of function 'floor' [-Wimplicit-function-declaration]
    7 |                                         dm=(int)floor(r*m);
      |                                                 ^~~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'floor'
  +++ |+#include <math.h>
    1 | 
main.c:7:49: warning: incompatible implicit declaration of built-in function 'floor' [-Wbuiltin-declaration-mismatch]
    7 |                                         dm=(int)floor(r*m);
      |                                                 ^~~~~
main.c:7:49: note: include '<math.h>' or provide a declaration of 'floor'
main.c:12:50: warning: incompatible implicit declaration of built-in function 'floor' [-Wbuiltin-declaration-mismatch]
   12 |                                         dm+=(int)floor(r*m);
      |                                                  ^~~~~
main.c:12:50: note: include '<math.h>' or provide a declaration of 'floor'
main.c:19:1: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
   19 | exit(0);}
      | ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | 
main.c:19:1: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   19 | exit(0);}
      | ^~~~
main.c:19:1: note: include '<stdlib.h>' or provide a declaration of 'exit'