foo.cc: In function 'int work(int, int, int, int, int)':
foo.cc:9:149: warning: control reaches end of non-void function [-Wreturn-type]
if ((yy<x)&&(zz<=z)) {ii=i;do {ii++;f[k+1]=0;work(k+1,ii,f[k]+1,y+2*i*f[k],z-i*i*f[k]);}while (f[k+1]);f[k]++;}}while (ii);if (f[k]==j) f[k]=0;}}
^
foo.cc: In function 'int main()':
foo.cc:11:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&n,&m);if (m>14) {printf("0");return 0;}x=0;for (i=1;i<=m;i++) x+=i*i*i;if (x>n){printf("0");return 0;}
~~~~~^~~~~~~~~~~~~~