foo.cc: In function 'int main()':
foo.cc:30:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
~~~~~^~~~~~~~~~
foo.cc:31:59: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(register int i = 1; i <= n; i++) scanf("%d", &a[i].v), a[i].id = i;
~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
foo.cc:32:59: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(register int i = 1; i <= n; i++) scanf("%d", &b[i].v), b[i].id = i;
~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~