B. Barnicle
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

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 × 10B 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.

Input

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.

Output

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).

Examples
Input
8.549e2
Output
854.9
Input
8.549e3
Output
8549
Input
0.33e0
Output
0.33

题意:x = A × 10B 将科学计数法 转为为普通实数  不能有前导零  不能有后置零  
hack数据
0.0e0
0
2.40000e2
240 题解:模拟 注重细节处理 考虑要细致
 #include<bits/stdc++.h>
#define ll __int64
#define mod 1e9+7
#define PI acos(-1.0)
#define bug(x) printf("%%%%%%%%%%%%%",x);
using namespace std;
char a[];
char b[];
int main()
{
cin>>a;
int len=strlen(a);
int wei=;
int flag;
for(int i=;i<len;i++)//找到小数点
{
if(a[i]=='.')
flag=i;
}
int gg=;
int zha=;
for(int j=len-;j>flag;j--)//进多少位
{
if(a[j]=='e')
{
a[j]='\0';
break;
}
wei=wei+(a[j]-'')*gg;
gg*=;
a[j]='\0';
} len=strlen(a);
int weishu=len-(flag+);//现有小数位数
if(wei==&&weishu==&&a[]=='')//特判数据
{
cout<<a[]<<endl;
return ;
}
if(wei<weishu)
{
for(int j=flag;j<flag+wei;j++)
a[j]=a[j+];
a[flag+wei]='.';
}
if(wei==weishu)
{
for(int j=flag;j<flag+wei;j++)
a[j]=a[j+];
a[flag+wei]='\0';
}
if(wei>weishu)
{
for(int j=flag;j<flag+weishu;j++)
a[j]=a[j+];
for(int j=flag+weishu;j<flag+wei;j++)
a[j]='';
a[flag+wei]='\0';
}
int len1=strlen(a);
int aaa=;
int zzz=;
if(wei<weishu)//去掉后置零
{
for(int j=len1-;j>;j--)
{
if(zzz)
break;
if(a[j]!='')
zzz=;
if(a[j]==''||a[j]=='.')
a[j]='\0'; }
}
for(int i=;i<len1;i++)//去掉前导零
{
if(a[i]!=''||a[i+]=='.')
aaa=;
if(aaa)
{
cout<<a[i];
}
}
cout<<endl;
return ;
}

Codeforces Round #362 (Div. 2) B 模拟的更多相关文章

  1. Codeforces Round #249 (Div. 2) (模拟)

    C. Cardiogram time limit per test 1 second memory limit per test 256 megabytes input standard input ...

  2. Codeforces Round #366 (Div. 2) C 模拟queue

    C. Thor time limit per test 2 seconds memory limit per test 256 megabytes input standard input outpu ...

  3. Codeforces Round #362 (Div. 2) C. Lorenzo Von Matterhorn (类似LCA)

    题目链接:http://codeforces.com/problemset/problem/697/D 给你一个有规则的二叉树,大概有1e18个点. 有两种操作:1操作是将u到v上的路径加上w,2操作 ...

  4. #map+LCA# Codeforces Round #362 (Div. 2)-C. Lorenzo Von Matterhorn

    2018-03-16 http://codeforces.com/problemset/problem/697/C C. Lorenzo Von Matterhorn time limit per t ...

  5. 题解——Codeforces Round #508 (Div. 2) T1 (模拟)

    依照题意暴力模拟即可A掉 #include <cstdio> #include <algorithm> #include <cstring> #include &l ...

  6. Codeforces Round #281 (Div. 2) B 模拟

    B. Vasya and Wrestling time limit per test 2 seconds memory limit per test 256 megabytes input stand ...

  7. Codeforces Round #281 (Div. 2) A 模拟

    A. Vasya and Football time limit per test 2 seconds memory limit per test 256 megabytes input standa ...

  8. 【转载】【树形DP】【数学期望】Codeforces Round #362 (Div. 2) D.Puzzles

    期望计算的套路: 1.定义:算出所有测试值的和,除以测试次数. 2.定义:算出所有值出现的概率与其乘积之和. 3.用前一步的期望,加上两者的期望距离,递推出来. 题意: 一个树,dfs遍历子树的顺序是 ...

  9. Codeforces Round #362 (Div. 2) A.B.C

    A. Pineapple Incident time limit per test 1 second memory limit per test 256 megabytes input standar ...

随机推荐

  1. HTML 5.1 的 14 个新特性(含使用案例)

    HTML5 属于万维网联盟 (W3C), 这个组织为整个网络界提供了标准,如此形成的协议可在全世界通行.在 2016 年 11 月, W3C 对长期行使的 HTML 5 标准进行了更新,它是2年内的第 ...

  2. 漫谈Ajax在.Net中的使用

    引用地址:http://birdshover.cnblogs.com/archive/2006/07/03/441439.html AJAX出来的时间也不短了.虽然它在某些方面很受争议,但是瑕不掩瑜. ...

  3. Bootstrap 提示工具(Tooltip)插件的事件

    事件 下表列出了提示工具(Tooltip)插件中要用到的事件.这些事件可在函数中当钩子使用. 事件 描述 实例 show.bs.tooltip 当调用 show 实例方法时立即触发该事件. $('#m ...

  4. goaccess 安装

    今天尝试搭建goaccess,用于分析access.log文件,但安装并不顺利,小记一下自己遇到的问题及解决方法 系统环境:CentOS release 6.9 一.参照官网教程进行搭建 $ wget ...

  5. OpenFaceswap 入门教程(1):软件安装篇

    ---恢复内容开始--- 众多换脸软件中,DeepFaceLab其实是安装和使用最方便,更新最快的,但是由于其没有可是化界面,对于很新手来说,可能入门还是有点难度.那么今天就来介绍一款操作极其直观和简 ...

  6. 安装Mysql community server遇到计算机中丢失msvcr120.dll

    一.下载community server版本 Mysql community server版本:https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7 ...

  7. 数据预处理之独热编码(One-Hot Encoding)

    问题的由来 在很多机器学习任务中,特征并不总是连续值,而有可能是分类值. 例如,考虑以下三个特征: ["male","female"] ["from ...

  8. Js中的undefined和not defined

    1.undefined 已经声明,但未赋值 2.not defined 未声明,报错

  9. 设计模式之第9章-原型模式(Java实现)

    设计模式之第9章-原型模式(Java实现) “快到春节了,终于快放假了,天天上班好累的说.”“确实啊,最近加班比较严重,项目快到交付了啊.”“话说一到过节,就收到铺天盖地的短信轰炸,你说发短信就发吧, ...

  10. leetcode 【 Remove Duplicates from Sorted Array 】python 实现

    题目: Given a sorted array, remove the duplicates in place such that each element appear only once and ...