A+B
作者:
xianhai
,
2021-12-05 20:23:28
,
所有人可见
,
阅读 220
#include <iostream>
#include <sstream>
using namespace std;
int str2int(string s) {
int a = 0, minus = 1, i = 0;
if (s[0] == '-') {
minus = -1;
i = 1;
}
while (i < s.size()) {
if (s[i] != ',') {
a = a * 10 + (s[i] - '0');
}
i++;
}
return a * minus;
}
int main() {
string str;
while (getline(cin, str)) {
// cout << str << endl;
stringstream ssin(str);
string str1, str2;
ssin >> str1 >> str2;
// cout << str1 << ' ' << str2int(str1) << endl;
cout << (str2int(str1) + str2int(str2)) << endl;
}
return 0;
}