結果

問題 No.289 数字を全て足そう
ユーザー yagi2yagi2
提出日時 2017-04-14 01:14:19
言語 Java21
(openjdk 21)
結果
AC  
実行時間 174 ms / 1,000 ms
コード長 392 bytes
コンパイル時間 2,685 ms
コンパイル使用メモリ 71,160 KB
実行使用メモリ 58,444 KB
最終ジャッジ日時 2023-09-25 16:33:27
合計ジャッジ時間 7,278 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
56,080 KB
testcase_01 AC 119 ms
56,032 KB
testcase_02 AC 120 ms
56,096 KB
testcase_03 AC 118 ms
55,660 KB
testcase_04 AC 120 ms
55,424 KB
testcase_05 AC 158 ms
55,828 KB
testcase_06 AC 150 ms
56,304 KB
testcase_07 AC 162 ms
56,732 KB
testcase_08 AC 163 ms
58,444 KB
testcase_09 AC 148 ms
56,172 KB
testcase_10 AC 154 ms
56,660 KB
testcase_11 AC 166 ms
56,080 KB
testcase_12 AC 164 ms
57,080 KB
testcase_13 AC 162 ms
56,628 KB
testcase_14 AC 174 ms
56,416 KB
testcase_15 AC 163 ms
56,628 KB
testcase_16 AC 158 ms
56,628 KB
testcase_17 AC 165 ms
56,424 KB
testcase_18 AC 166 ms
56,164 KB
testcase_19 AC 160 ms
56,460 KB
testcase_20 AC 165 ms
56,608 KB
testcase_21 AC 117 ms
55,664 KB
testcase_22 AC 167 ms
56,248 KB
testcase_23 AC 160 ms
56,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String[] sp = sc.next().split("");

        int ans = 0;
        for (String s : sp) {
            if (Character.isDigit(s.charAt(0))) {
                ans += Integer.parseInt(s);
            }
        }
        System.out.println(ans);
    }
}
0