/*
2020/4/19
第二遍
*/
#include <iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
int main()
{
char str[100];
scanf("%s",str);
int index = -1;
for(int t = 0;t<strlen(str);t++)
{
if(str[t] == '.')
{
index = t;
break;
}
}
int i = 0;
if(str[0] == '0')
{
int count_num0 = 1;
i = 2;
while(str[i] == '0')
{
count_num0++;
i++;
}
printf("%c.",str[i]);
for(int j = i + 1;j<strlen(str);j++)
{
printf("%c",str[j]);
}
printf("e-%d\n",count_num0);
}
else if(index != -1)
{
printf("%c.",str[0]);
for(int j = 1;j<strlen(str);j++)
{
if(str[j]!='.')
printf("%c",str[j]);
}
printf("e%d\n",index-1);
}
else
{
printf("%c.",str[0]);
for(int j = 1;j<strlen(str);j++)
{
printf("%c",str[j]);
}
printf("e%d\n",strlen(str)-1);
}
return 0;
}
/*
0.00145
1.45e-3
123.456
1.23456e2
123456
1.23456e5
*/
2013-3
最新推荐文章于 2023-05-09 10:43:20 发布