Calculate 【PAT (Advanced Level) Practice】1001 A+B Format (20 分)_git and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits).

Input Specification:
Each input file contains one test case. Each case contains 【PAT (Advanced Level) Practice】1001 A+B Format (20 分)_git_02 pair of integers a and 【PAT (Advanced Level) Practice】1001 A+B Format (20 分)_PAT甲级_03 where 【PAT (Advanced Level) Practice】1001 A+B Format (20 分)_PAT甲级_04. The numbers are separated by a space.

Output Specification:
For each test case, you should output the sum of 【PAT (Advanced Level) Practice】1001 A+B Format (20 分)_git_02 and 【PAT (Advanced Level) Practice】1001 A+B Format (20 分)_PAT甲级_03 in one line. The sum must be written in the standard format.

Sample Input:

-1000000 9

Sample Output:

-999,991

#include<iostream>

using namespace std;

int main(){

int a, b;

cin >> a >> b;
int c = a + b;

string s = to_string(c);
string res;
for(int i = s.size() - 1, j = 0; i >= 0; i--){

res = s[i] + res;
j++;
if(j % 3 == 0 && i && s[i - 1] != '-'){
res = ',' + res;
j = 0;
}
}

cout << res << endl;

return 0;
}