結果

問題 No.289 数字を全て足そう
ユーザー villachvillach
提出日時 2017-10-13 16:00:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 170 ms / 1,000 ms
コード長 360 bytes
コンパイル時間 3,394 ms
コンパイル使用メモリ 74,768 KB
実行使用メモリ 54,348 KB
最終ジャッジ日時 2024-04-28 17:30:24
合計ジャッジ時間 7,945 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
53,820 KB
testcase_01 AC 128 ms
54,336 KB
testcase_02 AC 128 ms
53,624 KB
testcase_03 AC 130 ms
54,028 KB
testcase_04 AC 127 ms
53,628 KB
testcase_05 AC 139 ms
54,012 KB
testcase_06 AC 136 ms
53,772 KB
testcase_07 AC 150 ms
53,972 KB
testcase_08 AC 148 ms
54,348 KB
testcase_09 AC 135 ms
53,936 KB
testcase_10 AC 142 ms
54,008 KB
testcase_11 AC 147 ms
53,940 KB
testcase_12 AC 159 ms
54,072 KB
testcase_13 AC 143 ms
53,896 KB
testcase_14 AC 170 ms
54,280 KB
testcase_15 AC 149 ms
54,112 KB
testcase_16 AC 152 ms
54,096 KB
testcase_17 AC 154 ms
54,092 KB
testcase_18 AC 168 ms
54,220 KB
testcase_19 AC 159 ms
54,320 KB
testcase_20 AC 155 ms
54,172 KB
testcase_21 AC 129 ms
53,688 KB
testcase_22 AC 163 ms
53,780 KB
testcase_23 AC 169 ms
54,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class N289 {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String hoge = sc.nextLine();
		int meu = 0;
		char c;
		for(int i = 0;i < hoge.length();++i){
			c = hoge.charAt(i);
			if(c - 48 > 0 && c - 48 < 10){
				meu += c - 48;
			}
		}
		System.out.println(meu);
	}
}
0