結果

問題 No.289 数字を全て足そう
ユーザー kuramukuramu
提出日時 2016-01-19 17:24:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 80 ms / 1,000 ms
コード長 543 bytes
コンパイル時間 1,804 ms
コンパイル使用メモリ 75,804 KB
実行使用メモリ 38,984 KB
最終ジャッジ日時 2024-04-16 21:01:03
合計ジャッジ時間 3,934 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
37,356 KB
testcase_01 AC 51 ms
37,412 KB
testcase_02 AC 50 ms
37,404 KB
testcase_03 AC 47 ms
36,804 KB
testcase_04 AC 50 ms
37,084 KB
testcase_05 AC 52 ms
37,168 KB
testcase_06 AC 51 ms
37,392 KB
testcase_07 AC 55 ms
38,180 KB
testcase_08 AC 54 ms
37,928 KB
testcase_09 AC 56 ms
37,688 KB
testcase_10 AC 52 ms
37,080 KB
testcase_11 AC 59 ms
37,296 KB
testcase_12 AC 65 ms
37,908 KB
testcase_13 AC 60 ms
37,316 KB
testcase_14 AC 66 ms
37,984 KB
testcase_15 AC 55 ms
37,444 KB
testcase_16 AC 53 ms
37,188 KB
testcase_17 AC 56 ms
37,464 KB
testcase_18 AC 58 ms
37,956 KB
testcase_19 AC 54 ms
37,160 KB
testcase_20 AC 62 ms
37,164 KB
testcase_21 AC 50 ms
37,464 KB
testcase_22 AC 60 ms
37,720 KB
testcase_23 AC 80 ms
38,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.Character;
public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in));
		String line = stdReader.readLine();
		int ans = 0;
		for(int i=0;i<line.length();i++){
			if(line.charAt(i)>='0' && line.charAt(i) <= '9'){
				ans += Integer.parseInt(""+line.charAt(i));
			}
		}
		System.out.println(ans);
	}
}
0