Description
Read a single - precision floating point number to retain the three - digit number output this floating point number.
Input
There is only one line, a single precision floating point number.
OUTPUT
There is only one line, read the single precision floating point number.
Input Sample
12.34521
OUTPUT SAMPLE
12.345
source
Exercise (2-2)
idea
Format output with Printf.
Answer
CPP
include
include
using namespace std;
int Main ()
{{
Float a;
cin >> a;
Printf ("%1.3F", a);
Return 0;
}
Result
Used Memory: 200KB
Run time: 10ms
Language: G ++
Submit time: 2019-03-24 09:04:38
Proplem Link
[http://noi.openjudge.cn/ch0101/04/.
OpenJudge 04:Output floating-point numbers with 3 decimal places
Comments