http://techwave.jp/archives/a-source-code-written-by-mr-mikitani.html
書き直してみた
void reverse(char* text, int length)
{
int i = 0;
int j = length;
char temp;
temp = text[i];
text[j] = temp;
i++;
j--;
}
}
int add_comma(int n, int length, char *out)
{
int i = 1;
int j = 0;
n = n / 10;
while (n > 0) {
if ((i % 3) == 0) {
out[j] = ',';
j++;
}
i++;
j++;
n = n / 10;
}
return -1;
}
reverse(out, j);
return j;
}
最初はだれでも初心者