Tuesday, October 15, 2013

number of digits after decimal point in c++

they say, using c++ i can put n digits after decimal point: http://www.urionlinejudge.com.br/judge/helps

Number of digits after the decimal point

Using C++, this is one of the possible ways to format a number with 5 digits after the decimal point:
1
#include <iomanip>
In the main (before print the output, in any place), use: ​
1
cout << fixed << setprecision(5);

note: i havent tried it yet. but after trying if it really work, then i will let you now.

No comments:

Post a Comment