参考
2024-07-27 23:40:48
发布于:北京
34阅读
0回复
0点赞
#include <iostream>
using namespace std;
int main () {
unsigned long long a, b;
cin >> a >> b;
int stack[24], si = 0, c = 0;
while (a > 0 || b > 0) {
int t = a % 10 + b % 10 + c;
c = t / 10;
stack[++si] = t % 10;
a /= 10, b /= 10;
}
if (c != 0) stack[++si] = 1;
for (int i = si; i >= 1; i --) cout << stack[i];
cout << endl;
return 0;
}
这里空空如也
有帮助,赞一个