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:30:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if ((a[i] - position) >= b * min)
~~~~~~~~~~~~~~~~~~^~~~~~~~~~
foo.cc:36:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
else if (a[i] < near)
~~~~~^~~~~~
foo.cc:40:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
else if(a[i]==near)
~~~~^~~~~~
foo.cc:45:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
else if (a[i] == far)
~~~~~^~~~~~
foo.cc:58:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
else if (a[i] < far && a[i] > near)
~~~~~^~~~~
foo.cc:58:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
else if (a[i] < far && a[i] > near)
~~~~~^~~~~~
foo.cc:47:4: warning: 'j' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (j != -1)
^~
[Hydro](https://hydro.ac)提供评测服务