25std::string
add(std::string a, std::string b) {
26 std::string temp =
"";
32 while (a.length() < b.length()) {
37 while (b.length() < a.length()) {
42 for (
int i = a.length() - 1; i >= 0; i--) {
43 char val =
static_cast<char>(((a[i] - 48) + (b[i] - 48)) + 48 + carry);
59 while (temp[0] ==
'0' && temp.length() > 1) {
60 temp = temp.substr(1);