結果

問題 No.289 数字を全て足そう
ユーザー 4A9GN4A9GN
提出日時 2016-07-17 21:14:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 147 ms / 1,000 ms
コード長 339 bytes
コンパイル時間 2,105 ms
コンパイル使用メモリ 74,480 KB
実行使用メモリ 54,360 KB
最終ジャッジ日時 2024-04-23 15:08:27
合計ジャッジ時間 6,390 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
54,100 KB
testcase_01 AC 111 ms
53,096 KB
testcase_02 AC 129 ms
54,188 KB
testcase_03 AC 127 ms
54,032 KB
testcase_04 AC 110 ms
53,004 KB
testcase_05 AC 132 ms
53,848 KB
testcase_06 AC 116 ms
53,012 KB
testcase_07 AC 138 ms
54,236 KB
testcase_08 AC 135 ms
54,336 KB
testcase_09 AC 130 ms
53,824 KB
testcase_10 AC 141 ms
54,000 KB
testcase_11 AC 135 ms
54,112 KB
testcase_12 AC 145 ms
54,168 KB
testcase_13 AC 136 ms
53,892 KB
testcase_14 AC 143 ms
54,108 KB
testcase_15 AC 137 ms
54,180 KB
testcase_16 AC 133 ms
53,716 KB
testcase_17 AC 147 ms
53,944 KB
testcase_18 AC 139 ms
53,932 KB
testcase_19 AC 136 ms
54,352 KB
testcase_20 AC 145 ms
54,360 KB
testcase_21 AC 110 ms
53,004 KB
testcase_22 AC 146 ms
53,868 KB
testcase_23 AC 140 ms
54,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	String str = sc.next();
	char[] s = str.toCharArray();
	int ret = 0;

	for(char c:s) {
            if (c>='0' && c<='9') {
	        ret += c - '0';
	    }
        }

        System.out.println(ret);
    }
}	
0