結果

問題 No.289 数字を全て足そう
ユーザー 37zigen37zigen
提出日時 2016-03-29 13:15:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 154 ms / 1,000 ms
コード長 310 bytes
コンパイル時間 2,090 ms
コンパイル使用メモリ 79,000 KB
実行使用メモリ 41,796 KB
最終ジャッジ日時 2024-04-16 21:04:38
合計ジャッジ時間 6,491 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
41,592 KB
testcase_01 AC 130 ms
41,512 KB
testcase_02 AC 130 ms
41,660 KB
testcase_03 AC 129 ms
41,296 KB
testcase_04 AC 130 ms
41,128 KB
testcase_05 AC 132 ms
41,448 KB
testcase_06 AC 134 ms
41,532 KB
testcase_07 AC 144 ms
41,692 KB
testcase_08 AC 154 ms
41,256 KB
testcase_09 AC 137 ms
41,492 KB
testcase_10 AC 147 ms
41,352 KB
testcase_11 AC 144 ms
41,552 KB
testcase_12 AC 144 ms
41,796 KB
testcase_13 AC 145 ms
41,568 KB
testcase_14 AC 140 ms
41,540 KB
testcase_15 AC 143 ms
41,536 KB
testcase_16 AC 142 ms
41,452 KB
testcase_17 AC 146 ms
41,328 KB
testcase_18 AC 146 ms
41,432 KB
testcase_19 AC 146 ms
41,356 KB
testcase_20 AC 142 ms
41,512 KB
testcase_21 AC 131 ms
41,296 KB
testcase_22 AC 147 ms
41,472 KB
testcase_23 AC 145 ms
41,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder289;
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String str=sc.next();
		char[] s=str.toCharArray();
		int ret=0;
		for(char c:s){
			if(c>='0'&&c<='9'){
				ret+=c-'0';
			}
		}
		System.out.println(ret);
	}
}
0