# 超长正整数相加/华为机试(C/C++)

## 题目描述

/*
请设计一个算法完成两个超长正整数的加法。
输入参数：
String augend：被加数
返回值：加法结果
*/

{
/*在这里实现功能*/

return null;
}

## 输入

99999999999999999999999999999999999999999999999999
1


## 输出

100000000000000000000000000000000000000000000000000

## 代码：

//第七十六题  超长正整数相加
#include<iostream>
#include<string>
#include <algorithm>
using namespace std;
{
size_t str1Length = str1.size();
size_t str2Length = str2.size();
reverse(str1.begin(), str1.end());
reverse(str2.begin(), str2.end());
string rStr;
int flag = 0;
for (int i = 0; i < str1Length; i++)
{
char temp = str1[i] - '0' + str2[i] - '0' + flag;
temp = temp < 10 ?(flag=0, temp) : (flag = 1, temp - 10);
rStr += (temp+'0');
}
for (int j = str1Length; j < str2Length; j++)
{
char temp = str2[j] - '0' + flag;
temp = temp < 10 ? (flag = 0, temp) : (flag = 1, temp - 10);
rStr += (temp + '0');
}
if (flag == 1)
rStr += '1';
return rStr;
}
int main()
{
string str1, str2;
while (cin >> str1 >> str2)
{
size_t nLength1 = str1.size();
size_t nLength2 = str2.size();
string output_str;
if (nLength1 < nLength2)
}