题意:给出俩个整数a,b(不超过10^9) ,求a+b的值 ,并按照xxx,xxx,xxx的格式输出
#includeusing namespace std;int main() { int a, b; cin >> a >> b; string s = to_string(a + b); int len = s.length(); for (int i = 0; i < len; i++) { cout << s[i]; if (s[i] == '-') continue; if ((i + 1) % 3 == len % 3 && i != len - 1) cout << ","; } return 0;}