分三种情况,小数点在前在中在后。
#include <stdio.h>
#include <string.h>
int main()
{
char *p, P[10000];
int e;
p = P;
scanf("%[^E]E%d", P, &e);
if(*p++ == '-') putchar('-');
if(e < 0)
{
printf("0.");
for(e++; e; e++)
printf("0");
for(; *p; p++)
if(*p != '.')
putchar(*p);
}
else if(e >= 0)
{
putchar(*p++);
for(p++; e; e--)
putchar(*p ? *p++ : '0');
if(*p)
{
putchar('.');
while(*p) putchar(*p++);
}
}
return 0;
}