結果

問題 No.289 数字を全て足そう
ユーザー yu_017yu_017
提出日時 2019-01-14 10:14:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 166 ms / 1,000 ms
コード長 322 bytes
コンパイル時間 3,230 ms
コンパイル使用メモリ 72,116 KB
実行使用メモリ 56,572 KB
最終ジャッジ日時 2023-08-30 23:16:38
合計ジャッジ時間 7,784 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,728 KB
testcase_01 AC 119 ms
55,820 KB
testcase_02 AC 117 ms
55,916 KB
testcase_03 AC 116 ms
55,736 KB
testcase_04 AC 120 ms
55,504 KB
testcase_05 AC 132 ms
55,800 KB
testcase_06 AC 123 ms
56,384 KB
testcase_07 AC 145 ms
56,324 KB
testcase_08 AC 146 ms
56,084 KB
testcase_09 AC 123 ms
56,108 KB
testcase_10 AC 130 ms
56,264 KB
testcase_11 AC 153 ms
56,572 KB
testcase_12 AC 155 ms
56,056 KB
testcase_13 AC 154 ms
56,120 KB
testcase_14 AC 166 ms
55,864 KB
testcase_15 AC 143 ms
55,812 KB
testcase_16 AC 153 ms
55,760 KB
testcase_17 AC 148 ms
56,048 KB
testcase_18 AC 156 ms
54,124 KB
testcase_19 AC 143 ms
55,652 KB
testcase_20 AC 145 ms
55,720 KB
testcase_21 AC 116 ms
56,024 KB
testcase_22 AC 159 ms
55,836 KB
testcase_23 AC 151 ms
55,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class A000163 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		sc.close();

		int r = 0;
		for(char c:str.toCharArray()) {
			int a = Character.getNumericValue(c);
			if(0<a&&a<10)r+=a;
		}
		System.out.println(r);
	}

}
0