結果

問題 No.289 数字を全て足そう
ユーザー GrenacheGrenache
提出日時 2015-10-16 22:21:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 146 ms / 1,000 ms
コード長 419 bytes
コンパイル時間 3,306 ms
コンパイル使用メモリ 74,904 KB
実行使用メモリ 41,688 KB
最終ジャッジ日時 2024-04-16 19:08:50
合計ジャッジ時間 7,194 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
40,220 KB
testcase_01 AC 117 ms
41,424 KB
testcase_02 AC 117 ms
41,260 KB
testcase_03 AC 105 ms
40,160 KB
testcase_04 AC 105 ms
40,160 KB
testcase_05 AC 128 ms
41,248 KB
testcase_06 AC 122 ms
40,896 KB
testcase_07 AC 122 ms
40,376 KB
testcase_08 AC 146 ms
41,352 KB
testcase_09 AC 124 ms
41,100 KB
testcase_10 AC 124 ms
40,948 KB
testcase_11 AC 137 ms
41,688 KB
testcase_12 AC 129 ms
41,628 KB
testcase_13 AC 131 ms
41,296 KB
testcase_14 AC 122 ms
40,236 KB
testcase_15 AC 124 ms
40,356 KB
testcase_16 AC 137 ms
41,576 KB
testcase_17 AC 122 ms
40,520 KB
testcase_18 AC 144 ms
41,568 KB
testcase_19 AC 136 ms
41,508 KB
testcase_20 AC 141 ms
41,596 KB
testcase_21 AC 108 ms
40,000 KB
testcase_22 AC 142 ms
41,660 KB
testcase_23 AC 121 ms
40,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder289 {

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

        char[] s = sc.next().toCharArray();
        int ret = 0;
        for (int i = 0; i < s.length; i++) {
        	if (s[i] >= '0' && s[i] <= '9') {
        		ret += s[i] - '0';
        	}
        }

        System.out.println(ret);

        sc.close();
    }
}
0