using namespace std
string solution(const string& s) {
int idx = s.size()
for(int i = 0
if(s[i] == '.')
{
idx = i
break
}
string str = ""
for(int i = s.size() - 1
str += s[i]
int cnt = 0
for(int i = idx - 1
{
if(cnt % 3 == 0 && cnt)
str += ","
str += s[i]
}
reverse(str.begin() , str.end())
while(*str.begin() == ',' || *str.begin() == '0')
str.erase(0 , 1)
// cout << str << '\n'
return str
}
int main() {
cout << (solution("1294512.12412") == "1,294,512.12412") << endl
cout << (solution("0000123456789.99") == "123,456,789.99") << endl
cout << (solution("987654321") == "987,654,321") << endl
}