char * thousandSeparator(int n){
char* s = (char*)calloc(20,1);
sprintf(s,"%d",n);
int len = strlen(s);
if (len <= 3) return s;
char* str = (char*)calloc(20,1);
int i = len - 1;
int count = 0;
int j = i + len/3;
while(i>=0)
{
count++;
if (count % 4 == 0)
{
str[j--] = '.';
continue;
}
str[j--] = s[i--];
}
return &str[j+1];
}