結果

問題 No.289 数字を全て足そう
ユーザー omc-testomc-test
提出日時 2016-08-04 17:35:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 1,000 ms
コード長 333 bytes
コンパイル時間 3,450 ms
コンパイル使用メモリ 75,032 KB
実行使用メモリ 41,488 KB
最終ジャッジ日時 2024-04-24 15:29:48
合計ジャッジ時間 7,825 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
41,088 KB
testcase_01 AC 107 ms
41,124 KB
testcase_02 AC 96 ms
39,288 KB
testcase_03 AC 113 ms
39,456 KB
testcase_04 AC 103 ms
41,252 KB
testcase_05 AC 116 ms
41,292 KB
testcase_06 AC 109 ms
41,020 KB
testcase_07 AC 107 ms
40,392 KB
testcase_08 AC 126 ms
40,128 KB
testcase_09 AC 113 ms
41,052 KB
testcase_10 AC 124 ms
40,280 KB
testcase_11 AC 113 ms
40,612 KB
testcase_12 AC 128 ms
41,076 KB
testcase_13 AC 108 ms
40,380 KB
testcase_14 AC 127 ms
41,432 KB
testcase_15 AC 118 ms
40,984 KB
testcase_16 AC 126 ms
41,152 KB
testcase_17 AC 128 ms
41,244 KB
testcase_18 AC 140 ms
41,156 KB
testcase_19 AC 135 ms
41,488 KB
testcase_20 AC 114 ms
40,292 KB
testcase_21 AC 105 ms
41,028 KB
testcase_22 AC 117 ms
40,288 KB
testcase_23 AC 141 ms
41,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class no0289 {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		char s[] = sc.next().toCharArray();
		int sum = 0;
		for(int i=0; i<s.length; i++){
			if(s[i] >= '0' && s[i] <= '9'){
				sum += Character.getNumericValue(s[i]);
			}
		}
		System.out.println(sum);
	}
}
0