結果

問題 No.289 数字を全て足そう
ユーザー core123core123
提出日時 2019-04-16 15:44:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 142 ms / 1,000 ms
コード長 288 bytes
コンパイル時間 2,044 ms
コンパイル使用メモリ 75,128 KB
実行使用メモリ 57,712 KB
最終ジャッジ日時 2023-10-22 07:05:14
合計ジャッジ時間 6,332 ms
ジャッジサーバーID
(参考情報)
judge10 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
57,416 KB
testcase_01 AC 122 ms
57,208 KB
testcase_02 AC 124 ms
57,376 KB
testcase_03 AC 124 ms
57,420 KB
testcase_04 AC 124 ms
57,432 KB
testcase_05 AC 135 ms
57,424 KB
testcase_06 AC 129 ms
57,348 KB
testcase_07 AC 140 ms
57,592 KB
testcase_08 AC 140 ms
57,424 KB
testcase_09 AC 130 ms
57,588 KB
testcase_10 AC 136 ms
57,712 KB
testcase_11 AC 140 ms
57,364 KB
testcase_12 AC 138 ms
57,640 KB
testcase_13 AC 139 ms
57,428 KB
testcase_14 AC 139 ms
57,248 KB
testcase_15 AC 139 ms
57,640 KB
testcase_16 AC 136 ms
57,440 KB
testcase_17 AC 140 ms
57,444 KB
testcase_18 AC 142 ms
57,440 KB
testcase_19 AC 140 ms
57,452 KB
testcase_20 AC 140 ms
57,676 KB
testcase_21 AC 125 ms
57,492 KB
testcase_22 AC 140 ms
57,248 KB
testcase_23 AC 127 ms
56,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.util.stream.*;
public class Main{
	public static void main(String... args){
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		int ans=0;
		for(char c:s.toCharArray()){
			if(Character.isDigit(c))ans+=(c-'0');
		}
		System.out.println(ans);
	}
}
0