結果

問題 No.289 数字を全て足そう
ユーザー fal_rndfal_rnd
提出日時 2017-03-13 23:59:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 1,000 ms
コード長 307 bytes
コンパイル時間 5,777 ms
コンパイル使用メモリ 71,888 KB
実行使用メモリ 56,132 KB
最終ジャッジ日時 2023-09-12 12:17:14
合計ジャッジ時間 7,589 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,688 KB
testcase_01 AC 120 ms
55,568 KB
testcase_02 AC 120 ms
55,692 KB
testcase_03 AC 119 ms
55,912 KB
testcase_04 AC 119 ms
55,732 KB
testcase_05 AC 127 ms
55,988 KB
testcase_06 AC 124 ms
55,836 KB
testcase_07 AC 134 ms
55,608 KB
testcase_08 AC 135 ms
55,856 KB
testcase_09 AC 128 ms
56,000 KB
testcase_10 AC 132 ms
53,888 KB
testcase_11 AC 134 ms
55,744 KB
testcase_12 AC 136 ms
55,920 KB
testcase_13 AC 134 ms
55,908 KB
testcase_14 AC 135 ms
55,892 KB
testcase_15 AC 134 ms
55,844 KB
testcase_16 AC 135 ms
55,832 KB
testcase_17 AC 135 ms
56,132 KB
testcase_18 AC 137 ms
55,888 KB
testcase_19 AC 135 ms
55,524 KB
testcase_20 AC 135 ms
55,932 KB
testcase_21 AC 120 ms
55,604 KB
testcase_22 AC 138 ms
55,868 KB
testcase_23 AC 137 ms
55,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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