#PCBBAY0000032. So sánh round(x,2) và .2f (Compare round and Fixed Formatting)
So sánh round(x,2) và .2f (Compare round and Fixed Formatting)
Compare round and Fixed Formatting
Version: Phuoc Hung OJ Extended
Problem Statement
Given a real number , show two representations of the same stored float. On the first line, print the float returned by round(x, 2) using Python’s default display. On the second line, directly format the original with .2f, always showing exactly two decimal places.
Input
One line contains real .
Output
Print exactly two lines: the default display of round(x, 2), followed by direct .2f formatting of .
Subtasks
- Subtask 1 (100 points): .
Examples
Example 1
Input
12.5
Output
12.5
12.50
Explanation. The default display of round(x, 2) is 12.5, whereas direct .2f formatting of the original value is 12.50. The second line always has two decimal digits.
Example 2
Input
3.14159
Output
3.14
3.14
Explanation. The default display of round(x, 2) is 3.14, whereas direct .2f formatting of the original value is 3.14. The second line always has two decimal digits.
Example 3
Input
2.675
Output
2.67
2.67
Explanation. The default display of round(x, 2) is 2.67, whereas direct .2f formatting of the original value is 2.67. The second line always has two decimal digits.