|
|
вернуться в форумIn this problem,rounding the double value to the nearest integer appeares to be the most tricky part of the whole problem. If you want to guarantee correct rounding, do it yourself with floor() and ceil(). At least,as it happened to me.:) You can do it like this: printf("%.0lf\n", res); You are absolutely right: ``cout << int(r)'' is WA, while ``printf("Distance is %.0lf km.", r);'' is AC. |
|
|