题解 | #添加逗号#
添加逗号
https://www.nowcoder.com/practice/f51c317e745649c0900996fd3f683aed
#include <iostream>
#include<string>
using namespace std;
int main() {
string str;
cin>>str;
int count=0;
for(int i=str.size()-1; i>0; i--){
count++;
if(count == 3){
str.insert(i, ",");
count=0;
}
}
cout<<str<<endl;
return 0;
}
// 64 位输出请用 printf("%lld")

