ぼるじょあがC/C++の宿題を片づけますYO! 67代目at TECH
ぼるじょあがC/C++の宿題を片づけますYO! 67代目 - 暇つぶし2ch101:デフォルトの名無しさん
06/12/16 23:59:43
int comma_format(long value, char *buf)
{
char temp[20];
int i, temp_len;

if(value<0) *buf++='-';
sprintf(temp, "%ld", labs(value));
temp_len=strlen(temp);
for(i=0;i<temp_len;i++)
{
*buf++=temp[i];
if((temp_len-i)%3==1)
*buf++=',';
}
buf[-1]='\0';

return 1;
}


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch