結果

問題 No.289 数字を全て足そう
ユーザー BantakoBantako
提出日時 2017-08-21 23:40:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 1,000 ms
コード長 272 bytes
コンパイル時間 2,148 ms
コンパイル使用メモリ 74,780 KB
実行使用メモリ 41,596 KB
最終ジャッジ日時 2024-04-23 01:41:20
合計ジャッジ時間 5,446 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
41,584 KB
testcase_01 AC 110 ms
41,328 KB
testcase_02 AC 109 ms
41,524 KB
testcase_03 AC 99 ms
41,296 KB
testcase_04 AC 110 ms
41,204 KB
testcase_05 AC 102 ms
41,156 KB
testcase_06 AC 115 ms
41,320 KB
testcase_07 AC 125 ms
40,396 KB
testcase_08 AC 132 ms
41,596 KB
testcase_09 AC 112 ms
41,272 KB
testcase_10 AC 127 ms
41,216 KB
testcase_11 AC 112 ms
41,320 KB
testcase_12 AC 123 ms
40,360 KB
testcase_13 AC 131 ms
41,524 KB
testcase_14 AC 127 ms
41,476 KB
testcase_15 AC 118 ms
41,320 KB
testcase_16 AC 127 ms
41,584 KB
testcase_17 AC 125 ms
41,468 KB
testcase_18 AC 128 ms
41,500 KB
testcase_19 AC 128 ms
41,472 KB
testcase_20 AC 112 ms
41,448 KB
testcase_21 AC 98 ms
41,360 KB
testcase_22 AC 121 ms
41,352 KB
testcase_23 AC 124 ms
41,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
class Y289{
    public static void main(String[] args){
        char[] str = new Scanner(System.in).next().toCharArray();
        int sum = 0;
        for(char c:str)if(c >= '1' && c <= '9')sum += c - '0';
        System.out.println(sum);
    }
}
0