結果

問題 No.9011 数字を全て足そう(数字だけ)
ユーザー testtest
提出日時 2022-11-14 21:09:55
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 298 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 5,332 KB
実行使用メモリ 42,344 KB
最終ジャッジ日時 2023-10-14 04:09:41
合計ジャッジ時間 4,223 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
42,112 KB
testcase_01 AC 76 ms
42,112 KB
testcase_02 AC 78 ms
42,160 KB
testcase_03 AC 78 ms
41,992 KB
testcase_04 AC 79 ms
42,168 KB
testcase_05 AC 78 ms
41,928 KB
testcase_06 AC 77 ms
42,124 KB
testcase_07 AC 78 ms
41,952 KB
testcase_08 AC 79 ms
42,100 KB
testcase_09 AC 79 ms
42,064 KB
testcase_10 AC 79 ms
42,040 KB
testcase_11 AC 78 ms
42,152 KB
testcase_12 AC 79 ms
41,928 KB
testcase_13 AC 78 ms
42,060 KB
testcase_14 AC 79 ms
42,100 KB
testcase_15 AC 78 ms
41,956 KB
testcase_16 AC 79 ms
42,152 KB
testcase_17 AC 79 ms
42,124 KB
testcase_18 AC 80 ms
42,344 KB
testcase_19 AC 79 ms
41,932 KB
testcase_20 AC 79 ms
42,084 KB
testcase_21 AC 79 ms
41,956 KB
testcase_22 AC 80 ms
42,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

function chkInt(str) {
    if (isNaN(str)) return 0;
    return parseInt(str);
}
function Main(input) {
    let src = input.replace("\n", "").split("");
    let sum = 0;
    src.forEach(str => { sum += chkInt(str); });
    console.log(sum);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0