foo.cc: In function 'int main()':
foo.cc:22:8: warning: statement has no effect [-Wunused-value]
for (i; i < num; i++)
^
foo.cc:26:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (a[i] > far)
~~~~~^~~~~
foo.cc:31:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
else if (a[i] < near)
~~~~~^~~~~~
foo.cc:35:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
else if (a[i] == near)
~~~~~^~~~~~~
foo.cc:40:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
else if (a[i] == far)
~~~~~^~~~~~
foo.cc:53:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
else if (a[i] < far && a[i] > near)
~~~~~^~~~~
foo.cc:53:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
else if (a[i] < far && a[i] > near)
~~~~~^~~~~~
foo.cc:42:4: warning: 'j' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (j != -1)
^~
[Hydro](https://hydro.ac)提供评测服务