結果

問題 No.784 「,(カンマ)」
ユーザー hoge1e3
提出日時 2019-02-26 10:09:19
言語 JavaScript
(node v23.5.0)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 371 bytes
コンパイル時間 44 ms
コンパイル使用メモリ 6,688 KB
実行使用メモリ 42,344 KB
最終ジャッジ日時 2024-10-13 00:59:24
合計ジャッジ時間 1,691 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

var lines=[];
var reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});
reader.on('line', function (line) {
  lines.push(line);
});
reader.on('close', function () {
  var l=lines[0];
  var pad=(3-(l.length%3))%3;
  l=["","0","00"][pad]+l;
  l=l.replace(/\d\d\d/g,"$&,").substr(pad).replace(/,$/,"");
  console.log(l);
});
0