CF697B.Barnicle

普及/提高-

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate.

Barney asked the bar tender Carl about this distance value, but Carl was so busy talking to the customers so he wrote the distance value (it's a real number) on a napkin. The problem is that he wrote it in scientific notation. The scientific notation of some real number x is the notation of form AeB, where A is a real number and B is an integer and x = A × 10_B_ is true. In our case A is between 0 and 9 and B is non-negative.

Barney doesn't know anything about scientific notation (as well as anything scientific at all). So he asked you to tell him the distance value in usual decimal representation with minimal number of digits after the decimal point (and no decimal point if it is an integer). See the output format for better understanding.

巴尼正站在酒吧里,凝望着一位漂亮的姑娘。他想用“心形箭”射中她,但为了确保命中,他需要知道他与姑娘之间的距离。

巴尼向酒保卡尔询问了这段距离的数值,但卡尔正忙着与顾客交谈,于是他把该距离值(一个实数)写在了一张纸巾上。问题在于,他用的是科学计数法表示的。某个实数 xx 的科学计数法形式为 AeBAeB,其中 AA 是一个实数,BB 是一个整数,且满足 x=A×10Bx = A \times 10^B。在本题中,AA 满足 0<A<90 < A < 9,且 BB 为非负整数。

巴尼对科学计数法一无所知(事实上,他对任何科学知识都一窍不通)。因此,他请你将该距离值转换为常规的十进制表示形式,要求小数点后的位数尽可能少(若结果为整数,则不输出小数点)。请参见输出格式以进一步理解要求。

输入格式

The first and only line of input contains a single string of form a.deb where a, d and b are integers and e is usual character 'e' (0 ≤ a ≤ 9, 0 ≤ d < 10100, 0 ≤ b ≤ 100) — the scientific notation of the desired distance value.

a and b contain no leading zeros and d contains no trailing zeros (but may be equal to 0). Also, b can not be non-zero if a is zero.

输入仅有一行,包含一个形如 a.deb 的字符串,其中 a、d 和 b 为整数,e 为普通的字符 'e'(满足 0 ≤ _a_ ≤ 9,0 ≤ _d_ < 10^{100},0 ≤ _b_ ≤ 100)——该字符串表示所求距离值的科学计数法形式。

a 和 b 不含前导零,d 不含尾随零(但 d 可以等于 0)。此外,若 a 为 0,则 b 不能非零。

输出格式

Print the only real number x (the desired distance value) in the only line in its decimal notation.

Thus if x is an integer, print it's integer value without decimal part and decimal point and without leading zeroes.

Otherwise print x in a form of p.q such that p is an integer that have no leading zeroes (but may be equal to zero), and q is an integer that have no trailing zeroes (and may not be equal to zero).

在唯一的一行中输出唯一的实数 xx(所求的距离值),以十进制形式表示。

因此,若 xx 为整数,则仅输出其整数值,不带小数部分、小数点以及前导零。

否则,将 xx 输出为 p.qp.q 的形式,其中 pp 是一个无前导零的整数(但可以等于零),而 qq 是一个无尾随零的整数(且不能等于零)。

输入输出样例

  • 输入#1

    8.549e2

    输出#1

    854.9
  • 输入#2

    8.549e3

    输出#2

    8549
  • 输入#3

    0.33e0

    输出#3

    0.33

输入解题思路,AI测评打分。不知道怎么写?

首页