Description
Read a dual - precision floating point, keep 12 decimal numbers, and output this floating point number.
Input
There is only one line, a double - precision floating point number.
OUTPUT
There is only one line, retaining the floating point number of 12 decimals.
Input Sample
3.1415926535798932
OUTPUT SAMPLE
3.141592653580
source
Exercise (2-3)
idea
Format output with Printf.
Answer
CPP
include
include
using namespace std;
int Main ()
{{
double a;
cin >> a;
Printf ("%1.12F", a);
Return 0;
}
Result
Used Memory: 200KB
Run time: 10ms
Language: G ++
Submit time: 2019-03-24 09:06:16
Proplem Link
[http://noi.openjudge.cn/ch0101/05/> [1]
OpenJudge 05:Output floating-point numbers with 12 decimal places
Comments