結果

問題 No.289 数字を全て足そう
ユーザー GrenacheGrenache
提出日時 2015-10-16 22:21:44
言語 Java19
(openjdk 21)
結果
AC  
実行時間 124 ms / 1,000 ms
コード長 419 bytes
コンパイル時間 3,948 ms
コンパイル使用メモリ 71,860 KB
実行使用メモリ 56,164 KB
最終ジャッジ日時 2023-07-29 13:04:39
合計ジャッジ時間 6,753 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
55,596 KB
testcase_01 AC 110 ms
55,704 KB
testcase_02 AC 110 ms
56,164 KB
testcase_03 AC 109 ms
55,640 KB
testcase_04 AC 109 ms
55,680 KB
testcase_05 AC 119 ms
55,848 KB
testcase_06 AC 112 ms
56,144 KB
testcase_07 AC 119 ms
55,616 KB
testcase_08 AC 122 ms
55,832 KB
testcase_09 AC 117 ms
55,796 KB
testcase_10 AC 124 ms
55,708 KB
testcase_11 AC 123 ms
55,820 KB
testcase_12 AC 124 ms
55,956 KB
testcase_13 AC 116 ms
55,416 KB
testcase_14 AC 118 ms
55,956 KB
testcase_15 AC 119 ms
55,764 KB
testcase_16 AC 120 ms
55,984 KB
testcase_17 AC 120 ms
56,048 KB
testcase_18 AC 122 ms
56,076 KB
testcase_19 AC 121 ms
55,752 KB
testcase_20 AC 117 ms
55,600 KB
testcase_21 AC 103 ms
56,120 KB
testcase_22 AC 120 ms
55,764 KB
testcase_23 AC 118 ms
55,932 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