[求助]算法求助有那位哥哥姐姐帮小弟一把
#include<cstdio>union ITEM
{
int i;
float f;
}a;
char s[100];
int main()
{
puts("Program 6 by team X");
while(scanf("%s",s)!=EOF)
{
int tmp=0;
for(int i=1;s[i]!='\0';i++)tmp=tmp+tmp+s[i]-'0';
if(tmp==0)printf(" 0.000000e+000\n");
else
{
if(s[0]=='1')putchar('-');
else putchar(' ');
a.i=(((tmp>>8)+64)<<23)|((tmp&0xff)<<15);
printf("%e\n",a.f);
}
}
puts("End of program 6 by team X");
return 0;
}
那位哥哥姐姐,帮帮小弟把算法和思想发给我:luxiaowei84@126.com