There are no long stories here, no long introductions and no complicated settings. All you need is to read from an input a real number in a format that is specified below, and to write it to an output in another format that is described below as well.
Here a syntactical description of the used notions follows.
<digit> ::= 0|1|2|3|4|5|6|7|8|9
<unsigned integer number> ::= <digit>|<digit><unsigned integer number>
<sign> ::= +|-
<integer number> ::= <unsigned integer number>|<sign><unsigned integer number>
<exponent symbol> ::= e|E
<exponent> ::= <exponent symbol><integer number>
<simple unsigned real number> ::= <unsigned integer number>|.<unsigned integer number>|<unsigned integer number>.<unsigned integer number>
<simple real number> ::= <simple unsigned real number>|<sign><simple unsigned real number>
<real number> ::= <simple real number>|<simple real number><exponent>
Input
consists of one or several pairs of lines. The first line of a pair contains an arbitrary set of symbols S. A length of the string S doesn't exceed 100 symbols. The second line of a pair contains a integer number N (0 ≤ N ≤ 100). An input is ended with the pair of lines, the first one of them contains the only symbol "#".
Output
For each pair of lines your program should write to an output a message: "Not a floating point number", if the string
S is not a correct <real number> according to the given above specification. If
S represents a correct <real number>, your program should write to an output this number formatted as a <simple real number> with N symbols after a decimal point. While forming the result you ought to note:
- An integral part of a number should be non-empty.
- There shouldn't be leading zeroes in a non-zero integral part of a number. A zero integral part of a number should consist of an only zero.
- A fractional part of a number should contain exactly N symbols.
- There shouldn't be a sign "+" before a positive number.
- You shouldn't round off a number.
It is guaranteed that a length of a result will not exceed 200 symbols.
Sample
input | output |
---|
10.23
0
.04
1
-0.051e0
1
1.1e30
10
-1.1E-30
1
2468097632.1358642324268913e-2
20
e23
3
1 e3
1
#
| 10
0.0
0.0
1100000000000000000000000000000.0000000000
0.0
24680976.32135864232426891300
Not a floating point number
Not a floating point number |
Notes
Note that the string S might contain any symbols with codes 32-255.
Problem Author: Alexander Klepinin
Problem Source: Ural State Univerisity Personal Contest Online February'2001 Students Session