题解 | #A+B#
A+B
http://www.nowcoder.com/practice/b183eac8dfba4de99d47c1ca4ce9571f
#include <cstdio>
#include <string>
using namespace std;
int main() {
string A, B;
while (cin >> A >> B) {
long long a = 0;
long long b = 0;
for(int i = 0; i < A.size(); i++) {
if (A[i] == ',' || A[i] == '-') {
continue;
}
a = a * 10 + (A[i] - '0');
}
if (A[0] == '-') {
a = -a;
}
for(int j = 0; j < B.size(); j++) {
if (B[j] == ',' || B[j] == '-') {
continue;
}
b = b * 10 + (B[j] - '0');
}
if (B[0] == '-') {
b = -b;
}
long long c = a + b;
cout << c << endl;
}
return 0;
}