結果

問題 No.289 数字を全て足そう
ユーザー nCk_cvnCk_cv
提出日時 2015-11-28 00:40:30
言語 Java21
(openjdk 21)
結果
AC  
実行時間 148 ms / 1,000 ms
コード長 423 bytes
コンパイル時間 2,167 ms
コンパイル使用メモリ 75,312 KB
実行使用メモリ 54,284 KB
最終ジャッジ日時 2024-04-16 19:22:20
合計ジャッジ時間 6,240 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
54,036 KB
testcase_01 AC 126 ms
53,808 KB
testcase_02 AC 126 ms
53,864 KB
testcase_03 AC 126 ms
53,704 KB
testcase_04 AC 127 ms
54,080 KB
testcase_05 AC 131 ms
53,996 KB
testcase_06 AC 128 ms
53,976 KB
testcase_07 AC 146 ms
54,068 KB
testcase_08 AC 147 ms
54,112 KB
testcase_09 AC 126 ms
53,772 KB
testcase_10 AC 135 ms
54,284 KB
testcase_11 AC 147 ms
54,164 KB
testcase_12 AC 138 ms
54,088 KB
testcase_13 AC 148 ms
54,152 KB
testcase_14 AC 141 ms
41,052 KB
testcase_15 AC 138 ms
41,184 KB
testcase_16 AC 143 ms
41,060 KB
testcase_17 AC 146 ms
41,096 KB
testcase_18 AC 139 ms
41,480 KB
testcase_19 AC 146 ms
41,224 KB
testcase_20 AC 144 ms
41,308 KB
testcase_21 AC 124 ms
41,128 KB
testcase_22 AC 139 ms
41,252 KB
testcase_23 AC 142 ms
41,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.util.Map.Entry;
import java.math.*;
import java.awt.geom.*;
import java.io.*;
      
      
public class Main {	

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] S = sc.next().toCharArray();
		int count = 0;
		for(int i = 0; i < S.length; i++) {
			if(S[i] >= '0' && S[i] <= '9') {
				count += S[i] - '0';
			}
		}
		System.out.println(count);
	}
}
0