Barnicle

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
分析:注意0.0e0;
代码:
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <climits>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <list>
#include <ext/rope>
#define rep(i,m,n) for(i=m;i<=n;i++)
#define rsp(it,s) for(set<int>::iterator it=s.begin();it!=s.end();it++)
#define vi vector<int>
#define pii pair<int,int>
#define mod 1000000007
#define inf 0x3f3f3f3f
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define pi acos(-1.0)
const int maxn=1e5+;
const int dis[][]={{,},{-,},{,-},{,}};
using namespace std;
using namespace __gnu_cxx;
ll gcd(ll p,ll q){return q==?p:gcd(q,p%q);}
ll qpow(ll p,ll q){ll f=;while(q){if(q&)f=f*p;p=p*p;q>>=;}return f;}
int n,m,now,len,cnt;
string a,ans;
int main()
{
int i,j,k,t;
cin>>a;
len=a.length(); //特判;
if(a=="0.0e0")return *puts(""); //找分隔符e;
for(now=;a[now]!='e';now++); //计算进位;
for(i=now+;i<len;i++)cnt=cnt*+a[i]-'';
ans+=a[]; //进位;
for(i=;i<cnt&&a[+i]!='e';i++)ans+=a[+i],now=+i; if(i!=cnt)for(;i<cnt;i++)ans+='';//不足补0;
else
{
ans+='.'; //小数部分;
for(;a[+i]!='e';i++)ans+=a[+i],now=+i;
} //处理答案前多余0;
for(i=;ans[i]=='';i++);
if(ans[i]=='.')i--;
ans.erase(,i); //处理小数点后末尾0;
len=ans.length();
if(count(ans.begin(),ans.end(),'.')!=)
{
len=ans.length();
for(i=len-;i>=&&(ans[i]==''||ans[i]=='.');i--);
ans=ans.substr(,i+);
}
cout<<ans<<endl;
//system ("pause");
return ;
}



 

最新文章

  1. CodeForces 618A Slime Combining
  2. iOS开发之Xcode 相对路径与绝对路径
  3. Hosts文件是什么?
  4. c#保留小数点后两位
  5. 017QTP 描述性编程的使用方法
  6. 拍照图片滤镜sample
  7. spark头脑镜像
  8. Android OpenGL ES 开发(八): OpenGL ES 着色器语言GLSL
  9. 网络协议 13 - HTTPS 协议:加密路上无尽头
  10. css属性应用bug大杂烩(后续继续更新)
  11. 1.3 Linux分区类型
  12. spring boot 系列之五:spring boot 通过devtools进行热部署
  13. API网关性能比较:NGINX vs. ZUUL vs. Spring Cloud Gateway vs. Linkerd(转)
  14. Python基础知识之疑点难点
  15. time since epoch
  16. cookie js案例
  17. Linux Jenkins配置Git
  18. Django中MySQL读写分离技术
  19. Web服务的实质介绍
  20. leetcode807

热门文章

  1. HDU 2732 Leapin&#39; Lizards
  2. Web开发人员不要错过的60款用户界面设计工具(上)
  3. 其他应用和技巧-eval()函数大行其道
  4. document.domain的修改问题
  5. sort函数使用的基本知识
  6. WisKey的眼神
  7. MySQL的索引创建、删除
  8. TFS 创建分支
  9. 转 由一次磁盘告警引发的血案:du 和 ls 的区别
  10. PHP 上传图片,生成水印,支持文字, gif, png