Big number summation(UVA 495)
code: #include<iostream> #define size 10000 using namespace std; int max_fibo=0; string fibo_n[5001]; string big_sum(string s1,string s2){ int l1,l2,carry=0; int sum,i=0; char result[size],ch; for(l1=0;s1[l1]!='\0';l1++); for(l2=0;s2[l2]!='\0';l2++); for(l1--,l2--;l1>=0;l1--,l2--){ if(l2>=0){ sum=(s1[l1]-'0')+(s2[l2]-'0')+carry; }else sum=(s1[l1]-'0')+carry; carry=sum/10; result[i++]=(sum%10)+'0'; }if(carry) result[i++]=carry+'0'; result[i]='\0'; for(l2=0;result[l2]!='\0';l2++); l1=0; for(l2--;l1<l2;l2--,l1++){ ...