通过字符串实现加法
#include <iostream>
#include <string>
using namespace std;
string add(string strLeft, string strRight)
{
for(string::size_type i = 0; i < strLeft.size(); ++i)
{
strLeft[i] -= '0';
}
for(string::size_type i = 0; i < strRight.size(); ++i)
{
strRight[i] -= '0';
}
int carry(0);
string::size_type maxBits = max(strLeft.size(), strRight.size()) + 1;
string strResult(maxBits, 0);
int i = maxBits - 1;
int j = strLeft.size() - 1;
while(j >= 0)
{
strResult[i--] = strLeft[j--];
}
i &#