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

Common Board

c++ whit decimals
Posted by Paul Diac 21 Apr 2004 13:49
How do I print a folat or double with 2 decimals in c++??
in c is printf("%f.2",x) but in c++?
I know this:
#include <iomanip.h>
fout<<setprecision(2)<<x;
but this dosen't work under linux.
Re: c++ whit decimals
Posted by morbidel 22 Apr 2004 16:54
try printf("%.2f", x)
you could read BC's help on printf. There are useful things said there