ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1119. Metro

use printf("%d", int(ans+0.5));
Posted by stupidjohn 30 Jun 2011 17:38
RT
Re: use printf("%d", int(ans+0.5));
Posted by Giorgi Pataraia [Tbilisi SU] 28 Mar 2012 13:32
thanks anyway. but i wonder why ceil(ans) doesnt work?
Re: use printf("%d", int(ans+0.5));
Posted by [MSU Detritus] freopen 31 Mar 2012 21:10
You should round to nearest decimal number. E.g. if ans=sqrt(2) then you should print 1.
Re: use printf("%d", int(ans+0.5));
Posted by Sunnat 25 Oct 2012 14:28
printf("%.0lf",ans);