#PCBBAY0000025. Định dạng general với 6 chữ số có nghĩa (General Format with Six Significant Digits)
Định dạng general với 6 chữ số có nghĩa (General Format with Six Significant Digits)
General Format with Six Significant Digits
Version: Phuoc Hung OJ Extended
Problem Statement
Given a real number , display it using 6 significant digits with Python 3 .6g general formatting. Depending on magnitude, this chooses fixed-point or scientific notation and omits unnecessary trailing zeros. Significant digits are not the same as digits after the decimal point.
Input
One line contains .
Output
Print one line using Python 3 .6g general formatting.
Subtasks
- Subtask 1 (100 points): is a finite Python float.
Examples
Example 1
Input
12345.6789
Output
12345.7
Explanation. For input 12345.6789, applying .6g formatting produces exactly 12345.7 (including any trailing zeros, separators or exponent characters).
Example 2
Input
0.001234567
Output
0.00123457
Explanation. For input 0.001234567, applying .6g formatting produces exactly 0.00123457 (including any trailing zeros, separators or exponent characters).
Example 3
Input
12.0
Output
12
Explanation. For input 12.0, applying .6g formatting produces exactly 12 (including any trailing zeros, separators or exponent characters).