Language: C

t[][],j;main(p,W,a,b,c){for(;scanf("%d",&W),W;printf("Case %d:\n%d\n%d\n",p++,t[0][W],j)){for(scanf("%d",&c);c&&scanf("%d,%d",&b,&a);c--)for(j=0;j<=W;j++)t[c-1][j]=(j<a)?t[c][j]:(t[c][j]>t[c][j-a]+b)?t[c][j]:(t[c][j-a]+b);for(j=0;t[0][j]-t[0][W];j++);}} 

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | t[][],j;main(p,W,a,b,c){for(;scanf("%d",&W),W;printf("Case %d:\n%d\n%d\n",p++,t[0][W],j)){for(scanf("%d",&c);c&&scanf("%d,%d",&b,&a);c--)for(j=0;j<=W;j++)t[c-1][j]=(j<a)?t[c][j]:(t[c][j]>t[c][j-a]+b)?t[c][j]:(t[c][j-a]+b);for(j=0;t[0][j]-t[0][W];j++);}}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
main.c:1:1: error: array type has incomplete element type 'int[]'
main.c:1:1: note: declaration of 't' as multidimensional array must have bounds for all dimensions except the first
main.c:1:7: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int]
    1 | t[][],j;main(p,W,a,b,c){for(;scanf("%d",&W),W;printf("Case %d:\n%d\n%d\n",p++,t[0][W],j)){for(scanf("%d",&c);c&&scanf("%d,%d",&b,&a);c--)for(j=0;j<=W;j++)t[c-1][j]=(j<a)?t[c][j]:(t[c][j]>t[c][j-a]+b)?t[c][j]:(t[c][j-a]+b);for(j=0;t[0][j]-t[0][W];j++);}}
      |       ^
main.c:1:9: error: return type defaults to 'int' [-Wimplicit-int]
    1 | t[][],j;main(p,W,a,b,c){for(;scanf("%d",&W),W;printf("Case %d:\n%d\n%d\n",p++,t[0][W],j)){for(scanf("%d",&c);c&&scanf("%d,%d",&b,&a);c--)for(j=0;j<=W;j++)t[c-1][j]=(j<a)?t[c][j]:(t[c][j]>t[c][j-a]+b)?t[c][j]:(t[c][j-a]+b);for(j=0;t[0][j]-t[0][W];j++);}}
      |         ^~~~
main.c: In function 'main':
main.c:1:9: error: type of 'p' defaults to 'int' [-Wimplicit-int]
main.c:1:9: error: type of 'W' defaults to 'int' [-Wimplicit-int]
main.c:1:9: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:9: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:9: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:1:30: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | t[][],j;main(p,W,a,b,c){for(;scanf("%d",&W),W;printf("Case %d:\n%d\n%d\n",p++,t[0][W],j)){for(scanf("%d",&c);c&&scanf("%d,%d",&b,&a);c--)for(j=0;j<=W;j++)t[c-1][j]=(j<a)?t[c][j]:(t[c][j]>t[c][j-a]+b)?t[c][j]:(t[c][j-a]+b);for(j=0;t[0][j]-t[0][W];j++);}}
      |                              ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | t[][],j;main(p,W,a,b,c){for(;scanf("%d",&W),W;printf("Case %d:\n%d\n%d\n",p++,t[0][W],j)){for(scanf("%d",&c);c&&scanf("%d,%d",&b,&a);c--)for(j=0;j<=W;j++)t[c-1][j]=(j<a)?t[c][j]:(t[c][j]>t[c][j-a]+b)?t[c][j]:(t[c][j-a]+b);for(j=0;t[0][j]-t[0][W];j++);}}
main.c:1:30: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | t[][],j;main(p,W,a,b,c){for(;scanf("%d",&W),W;printf("Case %d:\n%d\n%d\n",p++,t[0][W],j)){for(scanf("%d",&c);c&&scanf("%d,%d",&b,&a);c--)for(j=0;j<=W;j++)t[c-1][j]=(j<a)?t[c][j]:(t[c][j]>t[c][j-a]+b)?t[c][j]:(t[c][j-a]+b);for(j=0;t[0][j]-t[0][W];j++);}}
      |                              ^~~~~
main.c:1:30: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:47: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | t[][],j;main(p,W,a,b,c){for(;scanf("%d",&W),W;printf("Case %d:\n%d\n%d\n",p++,t[0][W],j)){for(scanf("%d",&c);c&&scanf("%d,%d",&b,&a);c--)for(j=0;j<=W;j++)t[c-1][j]=(j<a)?t[c][j]:(t[c][j]>t[c][j-a]+b)?t[c][j]:(t[c][j-a]+b);for(j=0;t[0][j]-t[0][W];j++);}}
      |                                               ^~~~~~
main.c:1:47: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:47: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:47: note: include '<stdio.h>' or provide a declaration of 'printf'