#PCBBAY0000018. Định dạng căn trái trong trường rộng 12 (Left Alignment in Width 12)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Định dạng căn trái trong trường rộng 12 (Left Alignment in Width 12)
Left Alignment in Width 12
Version: Phuoc Hung OJ Extended
Problem Statement
Format a real number with 2 digits after the decimal point, then place it in a field at least 12 characters wide. Left-align the formatted number and pad the right with spaces. Enclose the field between | characters; the spaces are part of the output.
Input
The only line contains a real number .
Output
Print a line of the form |field|, where field is left-aligned in a field at least 12 characters wide. Preserve all padding spaces.
Subtasks
- Subtask 1 (100 points): .
Examples
Example 1
Input
12.5
Output
|12.50 |
Explanation. The number first becomes 12.50. The 12-character field contains 0 leading and 7 trailing spaces; the | characters expose these spaces in |12.50 |.
Example 2
Input
-3.25
Output
|-3.25 |
Explanation. The number first becomes -3.25. The 12-character field contains 0 leading and 7 trailing spaces; the | characters expose these spaces in |-3.25 |.
Example 3
Input
123456.7
Output
|123456.70 |
Explanation. The number first becomes 123456.70. The 12-character field contains 0 leading and 3 trailing spaces; the | characters expose these spaces in |123456.70 |.