#include <iostream>#include <cstdlib>using namespace std;const int maxstr = 1024;char res[maxstr], temp[maxstr];char R[6], newR[6];int n, ling, dian, i, newRp;int times, reslen, range;int carry, bit, reserve, base, top;void multiply();int main(){ freopen("1001.txt","r",stdin); freopen("1001_.txt","w",stdout); while(cin>>R>>n) { for(ling=5;'0'==R[ling];--ling); for(dian=ling;'.'!=R[dian];--dian); newRp=0; range=n*(ling-dian); ++ling; for(i=0;i<dian;++i){ newR[newRp]=R[i]; newRp++; } for(i=dian+1;i<ling;++i){ newR[newRp]=R[i]; newRp++; } for(i=0;i<newRp;++i) res[i]=newR[newRp-i-1]; for(i=0;i<newRp;++i) newR[i]=res[i]; //while('0'==newR[newRp-1]) // newRp--; reslen=newRp;//----------------------------------------------- for(i=0;i<reslen;++i) res[i]-='0'; for(i=0;i<newRp;++i) newR[i]-='0';//----------------------------------------------- for(times=2;times<=n;++times){ multiply(); }//----------------------------------------------- for(i=0;i<reslen;++i) res[i]+='0'; for(i=0;i<newRp;++i) newR[i]+='0';//----------------------------------------------- if(range<reslen){ for(ling=reslen-1;'0'==res[ling];ling--); if(ling<0){ cout<<"0"; }else{ for(i=ling;i>=range;--i) cout<<res[i]; if(range>0){ cout<<'.'; for(i=range-1;i>=0;--i) cout<<res[i]; } } }else{ cout<<"."; for(i=0;i<range-reslen;++i) cout<<'0'; for(i=reslen-1;i>=0;--i) cout<<res[i]; } cout<<endl; } return 0;}void multiply()//multiply res[reslen] with newR[newRp];{ for(i=0;i<maxstr;++i) temp[i]=0; for(base=0;base<newRp;++base){ carry=0; for(top=0;top<reslen;++top){ bit=newR[base]*res[top]+carry; reserve=bit%10; carry=(bit-reserve)/10; temp[base+top]+=reserve; } temp[base+top]+=carry; } carry=0; for(i=0;i<maxstr;++i){ bit=temp[i]+carry; reserve=bit%10; carry=(bit-reserve)/10; temp[i]=reserve; } for(reslen=maxstr-1;0==temp[reslen];reslen--); reslen++; for(i=0;i<reslen;i++) res[i]=temp[i];}