結果

問題 No.289 数字を全て足そう
ユーザー syusyu
提出日時 2020-08-26 10:39:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 243 ms / 1,000 ms
コード長 428 bytes
コンパイル時間 3,060 ms
コンパイル使用メモリ 74,612 KB
実行使用メモリ 47,188 KB
最終ジャッジ日時 2024-04-24 16:52:02
合計ジャッジ時間 8,850 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
41,124 KB
testcase_01 AC 125 ms
41,560 KB
testcase_02 AC 127 ms
41,336 KB
testcase_03 AC 125 ms
41,412 KB
testcase_04 AC 129 ms
41,440 KB
testcase_05 AC 198 ms
44,748 KB
testcase_06 AC 182 ms
43,880 KB
testcase_07 AC 223 ms
46,560 KB
testcase_08 AC 221 ms
46,768 KB
testcase_09 AC 190 ms
44,976 KB
testcase_10 AC 206 ms
46,020 KB
testcase_11 AC 220 ms
46,384 KB
testcase_12 AC 230 ms
47,112 KB
testcase_13 AC 201 ms
46,516 KB
testcase_14 AC 241 ms
46,896 KB
testcase_15 AC 216 ms
46,864 KB
testcase_16 AC 217 ms
46,444 KB
testcase_17 AC 223 ms
47,144 KB
testcase_18 AC 233 ms
47,148 KB
testcase_19 AC 222 ms
46,988 KB
testcase_20 AC 226 ms
46,712 KB
testcase_21 AC 126 ms
40,996 KB
testcase_22 AC 236 ms
47,188 KB
testcase_23 AC 243 ms
47,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        String checkStr=sc.next();
        String[] letters=checkStr.split("");
        int count=0;
        for(String letter:letters){
            if(!(letter.matches("[a-zA-Z]"))){
                count+=Integer.parseInt(letter);
            }
        }
        System.out.println(count);
    }
}
0