foo.cc: In function 'void readdata()':
foo.cc:42:11: 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:47:21: 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: In function 'void work()':
foo.cc:54:9: warning: unused variable 'j' [-Wunused-variable]
int i,j,k,x;
^
foo.cc: In function 'void redirect()':
foo.cc:10:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
freopen("1.in","r",stdin);
~~~~~~~^~~~~~~~~~~~~~~~~~
foo.cc:11:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
freopen("1.out","w",stdout);
~~~~~~~^~~~~~~~~~~~~~~~~~~~
foo.cc: In function 'void readdata()':
foo.cc:26:8: 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:31:12: 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:45:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&k);
~~~~~^~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务