結果

問題 No.289 数字を全て足そう
ユーザー spaciaspacia
提出日時 2015-12-29 16:45:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 1,000 ms
コード長 487 bytes
コンパイル時間 1,896 ms
コンパイル使用メモリ 75,764 KB
実行使用メモリ 44,292 KB
最終ジャッジ日時 2024-04-16 20:59:42
合計ジャッジ時間 5,208 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
37,392 KB
testcase_01 AC 56 ms
37,172 KB
testcase_02 AC 56 ms
37,540 KB
testcase_03 AC 55 ms
37,100 KB
testcase_04 AC 56 ms
37,280 KB
testcase_05 AC 103 ms
42,052 KB
testcase_06 AC 91 ms
40,164 KB
testcase_07 AC 132 ms
43,920 KB
testcase_08 AC 138 ms
44,292 KB
testcase_09 AC 99 ms
41,796 KB
testcase_10 AC 107 ms
42,952 KB
testcase_11 AC 110 ms
43,808 KB
testcase_12 AC 131 ms
44,204 KB
testcase_13 AC 120 ms
43,740 KB
testcase_14 AC 135 ms
44,096 KB
testcase_15 AC 133 ms
43,764 KB
testcase_16 AC 124 ms
43,664 KB
testcase_17 AC 128 ms
43,708 KB
testcase_18 AC 131 ms
44,000 KB
testcase_19 AC 125 ms
43,740 KB
testcase_20 AC 128 ms
43,924 KB
testcase_21 AC 52 ms
37,212 KB
testcase_22 AC 135 ms
43,952 KB
testcase_23 AC 141 ms
44,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.math.*;

class Main289 {
	
	public static void out (Object out) {
		System.out.println(out);
	}
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		int ans = 0;
		String s = br.readLine();
		
		for (int i = 0; i < s.length(); i++) {
			if ((s.charAt(i) + "").matches("[0-9]")) {
				ans += s.charAt(i) - '0';
			}
		}
		
		out(ans);
		
	}
}
0