class Solution {
public:
string thousandSeparator(int n) {
if(n==0)return "0";
string s=to_string(n);
reverse(s.begin(),s.end());
string ans;
int cnt=1;
int i=0;//枚举原串每一位
while(i<=s.size()-1){
if(cnt%3==1&&cnt>3){
ans+=".";
}
ans+=s[i];
i++;
cnt++;
}
reverse(ans.begin(),ans.end());
return ans;
}
};