結果

問題 No.289 数字を全て足そう
ユーザー kou6839kou6839
提出日時 2015-10-21 12:30:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 155 ms / 1,000 ms
コード長 311 bytes
コンパイル時間 2,720 ms
コンパイル使用メモリ 76,316 KB
実行使用メモリ 41,968 KB
最終ジャッジ日時 2024-04-16 19:19:31
合計ジャッジ時間 6,395 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
41,336 KB
testcase_01 AC 132 ms
41,640 KB
testcase_02 AC 127 ms
41,312 KB
testcase_03 AC 124 ms
41,216 KB
testcase_04 AC 113 ms
40,388 KB
testcase_05 AC 138 ms
41,264 KB
testcase_06 AC 133 ms
41,332 KB
testcase_07 AC 145 ms
41,684 KB
testcase_08 AC 150 ms
41,884 KB
testcase_09 AC 134 ms
41,600 KB
testcase_10 AC 150 ms
41,152 KB
testcase_11 AC 146 ms
41,600 KB
testcase_12 AC 147 ms
41,372 KB
testcase_13 AC 131 ms
40,860 KB
testcase_14 AC 135 ms
40,776 KB
testcase_15 AC 130 ms
40,416 KB
testcase_16 AC 150 ms
41,276 KB
testcase_17 AC 155 ms
41,968 KB
testcase_18 AC 149 ms
41,556 KB
testcase_19 AC 141 ms
41,576 KB
testcase_20 AC 130 ms
40,340 KB
testcase_21 AC 111 ms
40,480 KB
testcase_22 AC 148 ms
41,828 KB
testcase_23 AC 153 ms
41,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String in = sc.next();
		int ans = 0;
		for(int i=0;i<in.length();i++) if(Character.isDigit(in.charAt(i))) ans+=Integer.parseInt(in.charAt(i)+"");
		System.out.println(ans);
		
	}
}
0