foo.cc: In function 'int main()':
foo.cc:22:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
22 | if (pos + 1 < h.size() && h[pos + 1] >= '5')
| ~~~~~~~~^~~~~~~~~~
foo.cc:25:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
25 | while (i < h.size() && h[i] != '.') cout << h[i++];
| ~~^~~~~~~~~~
foo.cc:30:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
30 | for (; i < h.size() && i <= pos + k; i++)
| ~~^~~~~~~~~~
foo.cc:32:43: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
32 | if (i == pos + k && i + 1 < h.size() && h[i + 1] >= '5')
| ~~~~~~^~~~~~~~~~
foo.cc:30:16: warning: 'i' may be used uninitialized [-Wmaybe-uninitialized]
30 | for (; i < h.size() && i <= pos + k; i++)
| ^
foo.cc:29:13: note: 'i' was declared here
29 | int i;
| ^
[Hydro](https://hydro.ac)提供评测服务