#include using namespace std; /////////////////// メイン /////////////////// int main () { //////////////////// 入力 //////////////////// string s; cin >> s; //////////////// 出力変数定義 //////////////// int result = 0; //////////////////// 処理 //////////////////// s += ','; int n = 0; for (char c : s) { if (c!=',') { n *= 10; n += c-'0'; } else { result += n; n = 0; } } //////////////////// 出力 //////////////////// cout << "a + b = " << result << endl; //////////////////// 終了 //////////////////// return 0; }