結果

問題 No.289 数字を全て足そう
ユーザー kamonegi2236kamonegi2236
提出日時 2015-11-14 13:00:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 212 ms / 1,000 ms
コード長 560 bytes
コンパイル時間 3,321 ms
コンパイル使用メモリ 75,256 KB
実行使用メモリ 57,572 KB
最終ジャッジ日時 2024-04-16 19:21:54
合計ジャッジ時間 8,399 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
54,252 KB
testcase_01 AC 129 ms
54,224 KB
testcase_02 AC 127 ms
54,124 KB
testcase_03 AC 129 ms
53,832 KB
testcase_04 AC 130 ms
53,896 KB
testcase_05 AC 169 ms
56,688 KB
testcase_06 AC 165 ms
54,720 KB
testcase_07 AC 198 ms
57,572 KB
testcase_08 AC 199 ms
57,132 KB
testcase_09 AC 168 ms
56,780 KB
testcase_10 AC 180 ms
56,720 KB
testcase_11 AC 196 ms
57,348 KB
testcase_12 AC 209 ms
57,376 KB
testcase_13 AC 185 ms
57,160 KB
testcase_14 AC 212 ms
57,516 KB
testcase_15 AC 178 ms
57,264 KB
testcase_16 AC 184 ms
57,300 KB
testcase_17 AC 193 ms
57,300 KB
testcase_18 AC 207 ms
57,244 KB
testcase_19 AC 192 ms
57,292 KB
testcase_20 AC 196 ms
56,928 KB
testcase_21 AC 127 ms
53,776 KB
testcase_22 AC 203 ms
57,528 KB
testcase_23 AC 175 ms
54,516 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.Arrays;
import java.util.List;
public class No289 {

	public static void main(String[] args) {
		
		int count=0;
		
		Scanner in = new Scanner(System.in);
        String str = in.next();
        List<String> list = Arrays.asList(str.split(""));
        for(String q :list){
        	count += toInt(q);
        }
		in.close();
        System.out.println(count); 
	}
	
	public static int toInt(String str){
		int ans = 0;
		
		try{
			ans = Integer.parseInt(str);
		}
		catch(Exception ex){
			
		}
		return ans;
	}

}
0