注意余数计算
#include<iostream>
#include<bits/stdc++.h>
#include<string>
using namespace std;
int a, b;
int main()
{
scanf("%d%d", &a, &b);
int c = a + b;
if (c < 0)printf("-"), c = -c;
int cnt = 0;
char s[30];
do
{
s[cnt++] = c % 10 + '0';
c /= 10;
} while (c);
s[cnt] = '\0';
int len = strlen(s);
string ans;
for (int i = 0; i < len; i++)
{
ans += s[i];
if ((i+1) % 3 == 0 && i != len - 1)ans += ',';
}
reverse(ans.begin(), ans.end());
cout << ans;
return 0;
}