foo.cc: In function 'void work()':
foo.cc:20:9: warning: unused variable 'j' [-Wunused-variable]
int i,j,k,x;
^
foo.cc: In function 'int main()':
foo.cc:71:8: warning: operation on 'l' may be undefined [-Wsequence-point]
d[++l].p=d[l-1].p+1,d[l].s=d[l-1].s+k;
^~~
foo.cc:75:22: warning: operation on 'l' may be undefined [-Wsequence-point]
while(d[l].s>=k)d[++l].p=d[l-1].p+1,d[l].s=d[l-1].s-k;
^~~
foo.cc:56:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d%d",&p1,&d[sum].p,&d[sum].s);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:61:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&d[sum].p,&d[sum].s);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:73:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&k);
~~~~~^~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务