#P5705. 【深基2.例7】数字反转
【深基2.例7】数字反转
Reversing a Number
Problem Source
Luogu P5705
Problem Description
Input a floating-point number that is at least and less than , and that has exactly one digit after the decimal point, for example . Reverse this number to become and output it.
Input Format
One line containing a floating-point number.
Output Format
One line containing a floating-point number.
Sample Input
123.4
Sample Output
4.321
Hint
- The input looks like
123.4: the integer part has 3 digits and the fractional part is fixed at 1 digit. - Handling it directly as a number is awkward — try reading it in as a string of characters (
string) and see what happens when you output it backwards. - Check against the sample:
123.4→4.321.