这个题很容易

终于找到了一个题能让我说出标题装装逼了

#include <iostream>
#include <string>

using namespace std;



int main() {
    int a;
    int b;
    int c;
    string value;
    cin >> a;
    cin >> b;
    c = a + b;
    value = to_string(c);
    if(value.size() <= 3) {
        cout << value;
        return 0;
    }
    int i = 0;
    int j = value.size() - 1;
    for(auto it = value.rbegin(); it != value.rend(); it++) {
        if(i == 2 && j != 0 && value[j - 1] != '-') {
            value.insert(j, ",");
            i = 0;
        } else {
            i++;
        }

        j--;
    }
    cout << value;
    return 0;
}

🌹💗正文结束💗🌹