Language: C

t[9999],W,N,a,b;main(c){for(;scanf("%d%d",&W,&N)-1;printf("Case %d:\n%d\n%d\n",c++,t[W],i),bzero(t,W*9)){for(;N--&&scanf("%d,%d",&a,&b);)for(i=W;i>=b;)t[i]=fmax(t[i--],t[i-b]+a);for(i=0;t[++i]-t[W];i);}}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | t[9999],W,N,a,b;main(c){for(;scanf("%d%d",&W,&N)-1;printf("Case %d:\n%d\n%d\n",c++,t[W],i),bzero(t,W*9)){for(;N--&&scanf("%d,%d",&a,&b);)for(i=W;i>=b;)t[i]=fmax(t[i--],t[i-b]+a);for(i=0;t[++i]-t[W];i);}}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
main.c:1:9: error: type defaults to 'int' in declaration of 'W' [-Wimplicit-int]
    1 | t[9999],W,N,a,b;main(c){for(;scanf("%d%d",&W,&N)-1;printf("Case %d:\n%d\n%d\n",c++,t[W],i),bzero(t,W*9)){for(;N--&&scanf("%d,%d",&a,&b);)for(i=W;i>=b;)t[i]=fmax(t[i--],t[i-b]+a);for(i=0;t[++i]-t[W];i);}}
      |         ^
main.c:1:11: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int]
    1 | t[9999],W,N,a,b;main(c){for(;scanf("%d%d",&W,&N)-1;printf("Case %d:\n%d\n%d\n",c++,t[W],i),bzero(t,W*9)){for(;N--&&scanf("%d,%d",&a,&b);)for(i=W;i>=b;)t[i]=fmax(t[i--],t[i-b]+a);for(i=0;t[++i]-t[W];i);}}
      |           ^
main.c:1:13: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
    1 | t[9999],W,N,a,b;main(c){for(;scanf("%d%d",&W,&N)-1;printf("Case %d:\n%d\n%d\n",c++,t[W],i),bzero(t,W*9)){for(;N--&&scanf("%d,%d",&a,&b);)for(i=W;i>=b;)t[i]=fmax(t[i--],t[i-b]+a);for(i=0;t[++i]-t[W];i);}}
      |             ^
main.c:1:15: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
    1 | t[9999],W,N,a,b;main(c){for(;scanf("%d%d",&W,&N)-1;printf("Case %d:\n%d\n%d\n",c++,t[W],i),bzero(t,W*9)){for(;N--&&scanf("%d,%d",&a,&b);)for(i=W;i>=b;)t[i]=fmax(t[i--],t[i-b]+a);for(i=0;t[++i]-t[W];i);}}
      |               ^
main.c:1:17: error: return type defaults to 'int' [-Wimplicit-int]
    1 | t[9999],W,N,a,b;main(c){for(;scanf("%d%d",&W,&N)-1;printf("Case %d:\n%d\n%d\n",c++,t[W],i),bzero(t,W*9)){for(;N--&&scanf("%d,%d",&a,&b);)for(i=W;i>=b;)t[i]=fmax(t[i--],t[i-b]+a);for(i=0;t[++i]-t[W];i);}}
      |                 ^~~~
main.c: In function 'main':
main.c:1:17: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:1:30: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | t[9999],W,N,a,b;main(c){for(;scanf("%d%d",&W,&N)-1;printf("Case %d:\n%d\n%d\n",c++,t[W],i),bzero(t,W*9)){for(;N--&&scanf("%d,%d",&a,&b);)for(i=W;i>=b;)t[i]=fmax(t[i--],t[i-b]+a);for(i=0;t[++i]-t[W];i);}}
      |                              ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | t[9999],W,N,a,b;main(c){for(;scanf("%d%d",&W,&N)-1;printf("Case %d:\n%d\n%d\n",c++,t[W],i),bzero(t,W*9)){for(;N--&&scanf("%d,%d",&a,&b);)for(i=W;i>=b;)t[i]=fmax(t[i--],t[i-b]+a);for(i=0;t[++i]-t[W];i);}}
main.c:1:30: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | t[9999],W,N,a,b;main(c){for(;scanf("%d%d",&W,&N)-1;printf("Case %d:\n%d\n%d\n",c++,t[W],i),bzero(t,W*9)){for(;N--&&scanf("%d,%d",&a,&b);)for(i=W;i>=b;)t[i]=fmax(t[i--],t[i-b]+a);for(i=0;t[++i]-t[W];i);}}
      |                              ^~~~~
main.c:1:30: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:52: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | t[9999],W,N,a,b;main(c){for(;scanf("%d%d",&W,&N)-1;printf("Case %d:\n%d\n%d\n",c++,t[W],i),bzero(t,W*9)){for(;N--&&scanf("%d,%d",&a,&b);)for(i=W;i>=b;)t[i]=fmax(t[i--],t[i-b]+a);for(i=0;t[++i]-t[W];i);}}
      |                                                    ^~~~~~
main.c:1:52: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:52: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:52: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:89: error: 'i' undeclared (first use in this function)
    1 | t[9999],W,N,a,b;main(c){for(;scanf("%d%d",&W,&N)-1;printf("Case %d:\n%d\n%d\n",c++,t[W],i),bzero(t,W*9)){for(;N--&&scanf("%d,%d",&a,&b);)for(i=W;i>=b;)t[i]=fmax(t[i--],t[i-b]+a);for(i=0;t[++i]-t[W];i);}}
      |                                                                                         ^
main.c:1:89: note: each undeclared identifier is reported only once for each function it appears in
main.c:1:92: error: implicit declaration of function 'bzero' [-Wimplicit-function-declaration]
    1 | t[9999],W,N,a,b;main(c){for(;scanf("%d%d",&W,&N)-1;printf("Case %d:\n%d\n%d\n",c++,t[W],i),bzero(t,W*9)){for(;N--&&scanf("%d,%d",&a,&b);)for(i=W;i>=b;)t[i]=fmax(t[i--],t[i-b]+a);for(i=0;t[++i]-t[W];i);}}
      |                                                                                            ^~~~~
main.c:1:92: warning: incompatible implicit declaration of built-in function 'bzero' [-Wbuiltin-declaration-mismatch]
main.c:1:157: error: implicit declaration of function 'fmax' [-Wimplicit-function-declaration]
    1 | t[9999],W,N,a,b;main(c){for(;scanf("%d%d",&W,&N)-1;printf("Case %d:\n%d\n%d\n",c++,t[W],i),bzero(t,W*9)){for(;N--&&scanf("%d,%d",&a,&b);)for(i=W;i>=b;)t[i]=fmax(t[i--],t[i-b]+a);for(i=0;t[++i]-t[W];i);}}
      |                                                                                                                                                             ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmax'
  +++ |+#include <math.h>
    1 | t[9999],W,N,a,b;main(c){for(;scanf("%d%d",&W,&N)-1;printf("Case %d:\n%d\n%d\n",c++,t[W],i),bzero(t,W*9)){for(;N--&&scanf("%d,%d",&a,&b);)for(i=W;i>=b;)t[i]=fmax(t[i--],t[i-b]+a);for(i=0;t[++i]-t[W];i);}}
main.c:1:157: warning: incompatible implicit declaration of built-in function 'fmax' [-Wbuiltin-declaration-mismatch]
    1 | t[9999],W,N,a,b;main(c){for(;scanf("%d%d",&W,&N)-1;printf("Case %d:\n%d\n%d\n",c++,t[W],i),bzero(t,W*9)){for(;N--&&scanf("%d,%d",&a,&b);)for(i=W;i>=b;)t[i]=fmax(t[i--],t[i-b]+a);for(i=0;t[++i]-t[W];i);}}
      |                                                                                                                                                             ^~~~
main.c:1:157: note: include '<math.h>' or provide a declaration of 'fmax'