結果

問題 No.289 数字を全て足そう
ユーザー shinwisteriashinwisteria
提出日時 2017-03-18 19:08:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 161 ms / 1,000 ms
コード長 342 bytes
コンパイル時間 4,200 ms
コンパイル使用メモリ 71,780 KB
実行使用メモリ 56,040 KB
最終ジャッジ日時 2023-09-18 02:32:34
合計ジャッジ時間 8,214 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,604 KB
testcase_01 AC 121 ms
55,972 KB
testcase_02 AC 120 ms
55,944 KB
testcase_03 AC 119 ms
56,040 KB
testcase_04 AC 119 ms
55,700 KB
testcase_05 AC 134 ms
55,808 KB
testcase_06 AC 129 ms
55,916 KB
testcase_07 AC 161 ms
55,720 KB
testcase_08 AC 151 ms
55,728 KB
testcase_09 AC 128 ms
55,664 KB
testcase_10 AC 134 ms
55,860 KB
testcase_11 AC 158 ms
55,520 KB
testcase_12 AC 158 ms
55,604 KB
testcase_13 AC 151 ms
55,572 KB
testcase_14 AC 160 ms
55,728 KB
testcase_15 AC 146 ms
56,040 KB
testcase_16 AC 145 ms
55,664 KB
testcase_17 AC 155 ms
55,724 KB
testcase_18 AC 154 ms
55,832 KB
testcase_19 AC 146 ms
53,716 KB
testcase_20 AC 152 ms
55,576 KB
testcase_21 AC 116 ms
55,780 KB
testcase_22 AC 159 ms
55,532 KB
testcase_23 AC 161 ms
55,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Tas {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		char[] c = s.nextLine().toCharArray();
		s.close();
		int total = 0;
		
		for(char c2 : c){
			if(Character.isDigit(c2)){
				total += Character.getNumericValue(c2);
			}
		}
		
		System.out.println(total);

	}

}
0