pat乙级1024

#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
int i=0,e=0,pos;
cin>>s;
while(s[i]!='E'){
i++;
}
pos=i;
i+=2;
for(i;i<s.length();i++){
e=e*10+s[i]-'0';
}
if(s[0]=='-') printf("-");
if(s[pos+1]=='-'){
printf("0.");
for(i=e;i>1;i--) printf("0");
printf("%c",s[1]);
for(i=3;i<pos;i++) printf("%c",s[i]);
}else{
printf("%c",s[1]);
if(e>=pos-3){
for(i=3;i<pos;i++) printf("%c",s[i]);
for(i=e-pos+3;i>0;i--) printf("0");
}else{
for(i=3;i<3+e;i++) printf("%c",s[i]);
printf(".");
for(i=3+e;i<pos;i++) printf("%c",s[i]);
}
}
return 0;
}

posted @ 2019-02-19 19:33  捕鱼儿海  阅读(102)  评论(0编辑  收藏  举报