sortbooks.cpp:17:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
main()
^
sortbooks.cpp: In function 'int main()':
sortbooks.cpp:20:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d", &n, &m);
~~~~~^~~~~~~~~~~~~~~~
sortbooks.cpp:23:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &a[i]);
~~~~~^~~~~~~~~~~~~
sortbooks.cpp:31:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d%d", &l, &r, &k);
~~~~~^~~~~~~~~~~~~~~~~~~~~~
sortbooks.cpp:27:9: warning: 'pos' may be used uninitialized in this function [-Wmaybe-uninitialized]
mx[i] = pos;
~~~~~~^~~~~