結果

問題 No.289 数字を全て足そう
ユーザー kazapyon27kazapyon27
提出日時 2017-05-05 11:08:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 76 ms / 1,000 ms
コード長 535 bytes
コンパイル時間 3,137 ms
コンパイル使用メモリ 71,388 KB
実行使用メモリ 51,908 KB
最終ジャッジ日時 2023-10-12 09:42:28
合計ジャッジ時間 5,697 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,560 KB
testcase_01 AC 42 ms
49,384 KB
testcase_02 AC 42 ms
49,324 KB
testcase_03 AC 42 ms
49,328 KB
testcase_04 AC 41 ms
49,648 KB
testcase_05 AC 48 ms
49,760 KB
testcase_06 AC 46 ms
49,536 KB
testcase_07 AC 57 ms
51,472 KB
testcase_08 AC 57 ms
51,172 KB
testcase_09 AC 46 ms
49,320 KB
testcase_10 AC 48 ms
49,360 KB
testcase_11 AC 54 ms
49,344 KB
testcase_12 AC 61 ms
51,316 KB
testcase_13 AC 51 ms
49,348 KB
testcase_14 AC 57 ms
50,552 KB
testcase_15 AC 57 ms
51,908 KB
testcase_16 AC 53 ms
49,328 KB
testcase_17 AC 57 ms
49,284 KB
testcase_18 AC 59 ms
51,208 KB
testcase_19 AC 53 ms
49,804 KB
testcase_20 AC 58 ms
51,128 KB
testcase_21 AC 42 ms
49,348 KB
testcase_22 AC 59 ms
51,248 KB
testcase_23 AC 76 ms
51,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/*No.289 数字を全て足そう*/
import java.io.*;
public class No289 {
	public static void main(String[] args) {
		String r_moji,moji;
		int result=0;
		try(BufferedReader input =new BufferedReader(new InputStreamReader(System.in))){
			r_moji=input.readLine();
			for(short i=0;i<r_moji.length();i++){
				moji=r_moji.substring(i, i+1);
				if(moji.codePointAt(0)>=48 &&moji.codePointAt(0)<=57){
					result+=Integer.parseInt(moji);
				}
			}
			System.out.println(result);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
0