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 formAeB, where A is a real number andB is an integer and x = A × 10B is true. In our caseA is between 0 and9 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.
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 andd contains no trailing zeros (but may be equal to0). Also, b can not be non-zero ifa is zero.
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), andq is an integer that have no trailing zeroes (and may not be equal to zero).
8.549e2
854.9
8.549e3
8549
0.33e0
0.33
题意:给出科学计数法,输出这个数究竟是多少
昨天做镜像题一次AC开心好久,今天就被打脸orz
其实判断起来也不麻烦,没几种条件,第一次交竟然MLE 23333,尼玛10^100范围已经吓死我了好吗,直接开最大1e9+7,谁知道竟然会MLE。改范围后还想着会不会有0.0e0这种坑货数据,手懒没写结果果然wa在这组23333,敢不敢再懒一点啊喂!意料之外的是wa在了1.0e0的数据,嗯,想来考虑还是不够全orz
继续修炼
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <stdlib.h>
#include <cmath>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <vector>
#include <fstream>
#include <iomanip>
#define INF 0x3f3f3f3f
using namespace std;
char s[100000005];
int main()
{
while (scanf("%s", s) != EOF) {
int len = strlen(s);
int locd = -1; //小数点的位置
int loce = -1; //一个数的结尾
int locs = -1;
bool flagcnt = 0; //是不是全是0,为了判断0.0类数据设的flagcnt
for (int i = 0; i < len; i++) {
if(s[i] == '.') locd = i;
if(s[i] == 'e') {
loce = i - 1;
locs = i + 1;
}
}
for(int i = 0; i <= loce; i++) {
if(s[i] != '0' && s[i] != '.') {
flagcnt = 1;
break;
}
}
for(int i = loce; i >= 0; i--) {
if(s[i] == '.') continue;
if(s[i] == '0') continue;
loce = i;
break;
}
bool flagd = 0; //
if(loce < locd) flagd = 1;
int cnt = 0; //计算e后面的数字
for (int i = locs; i < len; i++) {
cnt = cnt * 10 + s[i] - '0';
}
locd = locd + cnt;
if (cnt == 0) {
if (!flagcnt) {
printf("0\n");
continue;
}
for (int i = 0; i <= loce; i++)
printf("%c", s[i]);
printf("\n");
continue;
}
int flag0 = 0; // 解决0.00003e1类数据设的flag0,以防输出一堆前导0
for (int i = 0; i <= loce; i++) {
if(s[i] == '.') continue;
if(s[i] == '0' && !flag0 && locd > i) continue;
flag0 = 1;
if(locd == i && locd < loce) printf("%c.", s[i]);
else printf("%c", s[i]);
}
if(flagd) locd--; //0.33e5类数据最后输出0
if (locd > loce) {
for(int i = loce; i < locd; i++)
printf("0");
}
printf("\n");
}
return 0;
}