C++大整数的加法通过字符数组实现
string plus_1(const string &a,const string &b) { string result; char ttemp[2]; int alen,blen,i,j; int add,temp; ttemp[1]='\0'; alen=a.size(); blen=b.size(); add=0; for(i=alen-1,j=blen-1;i>=0&&j>=0;i--,j--) { temp=add+((int)a[i]-48)+((int)b[j]-48); add=temp/10; ttemp[0]=temp%10+48;
下载地址
用户评论
感觉非常好,比我们同学编写的好得多