結果

問題 No.289 数字を全て足そう
ユーザー YOSHIYOSHI
提出日時 2021-03-09 19:00:27
言語 Java21
(openjdk 21)
結果
AC  
実行時間 63 ms / 1,000 ms
コード長 484 bytes
コンパイル時間 3,738 ms
コンパイル使用メモリ 74,620 KB
実行使用メモリ 38,200 KB
最終ジャッジ日時 2024-04-19 20:17:59
合計ジャッジ時間 5,782 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
37,004 KB
testcase_01 AC 48 ms
37,412 KB
testcase_02 AC 47 ms
37,020 KB
testcase_03 AC 48 ms
37,120 KB
testcase_04 AC 47 ms
37,192 KB
testcase_05 AC 48 ms
36,832 KB
testcase_06 AC 50 ms
36,976 KB
testcase_07 AC 52 ms
37,148 KB
testcase_08 AC 51 ms
37,248 KB
testcase_09 AC 48 ms
36,704 KB
testcase_10 AC 51 ms
36,704 KB
testcase_11 AC 57 ms
37,156 KB
testcase_12 AC 55 ms
37,364 KB
testcase_13 AC 50 ms
37,248 KB
testcase_14 AC 53 ms
36,996 KB
testcase_15 AC 52 ms
37,136 KB
testcase_16 AC 50 ms
36,972 KB
testcase_17 AC 51 ms
37,332 KB
testcase_18 AC 52 ms
37,176 KB
testcase_19 AC 51 ms
37,156 KB
testcase_20 AC 50 ms
37,148 KB
testcase_21 AC 48 ms
37,196 KB
testcase_22 AC 52 ms
36,924 KB
testcase_23 AC 63 ms
38,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No00000289_Main {

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		int sum = 0;
		for(int i = 0; i < str.length(); i++) {
			char c = str.charAt(i);
			if('0' <= c && c <= '9') sum +=Integer.parseInt(String.valueOf(c));
		}
		System.out.println(sum);
	}
}
0