結果

問題 No.289 数字を全て足そう
ユーザー YU Hirose
提出日時 2024-07-18 22:36:18
言語 JavaScript
(node v23.5.0)
結果
AC  
実行時間 158 ms / 1,000 ms
コード長 292 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 6,688 KB
実行使用メモリ 45,176 KB
最終ジャッジ日時 2024-07-18 22:36:24
合計ジャッジ時間 5,101 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(input) {
    input = input.split("\n");
    const s = input[0];
    let n = s.match(/\d/g);
    let res = 0;
    if (n) {
        n = n.map(a=>parseInt(a));
        res = n.reduce((x,y)=>x+y);
    }
    console.log(res);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0