結果

問題 No.289 数字を全て足そう
ユーザー t8m8⛄️t8m8⛄️
提出日時 2016-01-25 17:21:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 144 ms / 1,000 ms
コード長 736 bytes
コンパイル時間 3,532 ms
コンパイル使用メモリ 77,356 KB
実行使用メモリ 41,840 KB
最終ジャッジ日時 2024-04-16 21:01:45
合計ジャッジ時間 7,738 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
41,296 KB
testcase_01 AC 115 ms
40,016 KB
testcase_02 AC 127 ms
41,248 KB
testcase_03 AC 128 ms
41,684 KB
testcase_04 AC 128 ms
41,308 KB
testcase_05 AC 135 ms
41,360 KB
testcase_06 AC 132 ms
41,372 KB
testcase_07 AC 143 ms
41,252 KB
testcase_08 AC 143 ms
41,560 KB
testcase_09 AC 132 ms
41,692 KB
testcase_10 AC 138 ms
41,500 KB
testcase_11 AC 140 ms
41,744 KB
testcase_12 AC 144 ms
41,688 KB
testcase_13 AC 137 ms
41,596 KB
testcase_14 AC 142 ms
41,840 KB
testcase_15 AC 140 ms
41,452 KB
testcase_16 AC 139 ms
41,492 KB
testcase_17 AC 132 ms
40,444 KB
testcase_18 AC 142 ms
41,616 KB
testcase_19 AC 143 ms
41,244 KB
testcase_20 AC 138 ms
41,644 KB
testcase_21 AC 114 ms
40,084 KB
testcase_22 AC 140 ms
41,304 KB
testcase_23 AC 141 ms
41,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.awt.geom.*;
import java.math.*;

public class No0289 {

	static final Scanner in = new Scanner(System.in);
	static final PrintWriter out = new PrintWriter(System.out,false);

	static void solve() {
		String s = in.next();
		int n = s.length();
		int ans = 0;
		for (int i=0; i<n; i++) {
			if ('0' <= s.charAt(i) && s.charAt(i) <= '9') ans += s.charAt(i) - '0';
		}
		out.println(ans);
	}

	public static void main(String[] args) {
		long start = System.currentTimeMillis();

		solve();
		out.flush();

		long end = System.currentTimeMillis();
		//trace(end-start + "ms");
		in.close();
		out.close();
	}

	static void trace(Object... o) { System.out.println(Arrays.deepToString(o));}
}
0