foo.cc:23:3: error: expected unqualified-id before 'return'
} return 0;
^~~~~~
foo.cc:24:1: error: expected declaration before '}' token
}
^
foo.cc: In function 'int main()':
foo.cc:16:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for (int i=1;i<=10;i++) scanf("%d",&e[i]);
~~~~~^~~~~~~~~~~~
foo.cc:17:44: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for (int i=1;i<=n;i++) scanf("%d",&p[i].w),p[i].d=i;
~~~~~~~~~~~~~~~~~~~^~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务