#include #include #include using namespace std; string add(string s1,string s2) { const int MAX_NUM=200; int op1[MAX_NUM]; int op2[MAX_NUM]; int i; for (i=0;i=0){ op1[j++]=s1[i]-'0'; i--; } j=0; i=(int)(sLen2-1); while (i>=0){ op2[j++]=s2[i]-'0'; i--; } size_t sLen=max(sLen1,sLen2); int C=0; for (i=0;i=10){ op1[i]-=10; C=1; }else{ C=0; } } if (C>0){ op1[i]=C; C=0; sLen++; } string s; for (i=sLen-1;i>=0;i--){ s+=op1[i]+'0'; } return s; } int alignDecimal(string &S1,string &S2) { string s; string s1=S1; string s2=S2; size_t s1Len=s1.size(); size_t s2Len=s2.size(); size_t s1DecLen=0; size_t s2DecLen=0; char *p=strchr((char*)s1.c_str(),'.'); if (p){ s1DecLen = s1Len - (p-s1.c_str())-1; } p=strchr((char*)s2.c_str(),'.'); if (p){ s2DecLen = s2Len - (p-s2.c_str())-1; } size_t MaxDecLen=max(s1DecLen,s2DecLen); int i; for (i=0;i0){ s.insert(s1Len-MaxDecLen,"."); } return s; } int main(int argc, char* argv[]) { string D="0.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991"; int N; cin>>N; int i; string s=D; for (i=1;i