結果

問題 No.289 数字を全て足そう
ユーザー spacenautspacenaut
提出日時 2016-05-15 02:01:21
言語 Java21
(openjdk 21)
結果
AC  
実行時間 149 ms / 1,000 ms
コード長 329 bytes
コンパイル時間 1,997 ms
コンパイル使用メモリ 74,008 KB
実行使用メモリ 41,820 KB
最終ジャッジ日時 2024-04-16 21:07:30
合計ジャッジ時間 6,235 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
41,176 KB
testcase_01 AC 129 ms
41,264 KB
testcase_02 AC 128 ms
41,304 KB
testcase_03 AC 125 ms
41,420 KB
testcase_04 AC 127 ms
41,212 KB
testcase_05 AC 135 ms
41,688 KB
testcase_06 AC 134 ms
41,168 KB
testcase_07 AC 141 ms
41,432 KB
testcase_08 AC 142 ms
41,360 KB
testcase_09 AC 132 ms
41,372 KB
testcase_10 AC 139 ms
41,392 KB
testcase_11 AC 149 ms
41,176 KB
testcase_12 AC 143 ms
41,348 KB
testcase_13 AC 142 ms
41,524 KB
testcase_14 AC 143 ms
41,580 KB
testcase_15 AC 143 ms
41,320 KB
testcase_16 AC 138 ms
41,384 KB
testcase_17 AC 143 ms
41,396 KB
testcase_18 AC 128 ms
40,628 KB
testcase_19 AC 143 ms
41,392 KB
testcase_20 AC 146 ms
41,820 KB
testcase_21 AC 128 ms
41,640 KB
testcase_22 AC 144 ms
41,388 KB
testcase_23 AC 143 ms
41,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class No0289{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String str = sc.next();
		char[] s = str.toCharArray();
		int result = 0;
		
		for(int i  = 0; i < s.length; i++){
			if(s[i] >= '0' && s[i] <= '9') result += s[i] - '0';
		}
		System.out.println(result);
	}
}
0