結果

問題 No.289 数字を全て足そう
ユーザー rikiyarikiya
提出日時 2017-07-03 20:31:20
言語 Ruby
(3.3.0)
結果
AC  
実行時間 112 ms / 1,000 ms
コード長 186 bytes
コンパイル時間 44 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 15,232 KB
最終ジャッジ日時 2024-04-15 14:42:19
合計ジャッジ時間 3,459 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
12,160 KB
testcase_01 AC 90 ms
12,160 KB
testcase_02 AC 89 ms
12,160 KB
testcase_03 AC 90 ms
12,160 KB
testcase_04 AC 90 ms
12,288 KB
testcase_05 AC 99 ms
12,672 KB
testcase_06 AC 98 ms
12,160 KB
testcase_07 AC 109 ms
13,568 KB
testcase_08 AC 109 ms
13,568 KB
testcase_09 AC 97 ms
12,416 KB
testcase_10 AC 102 ms
13,312 KB
testcase_11 AC 106 ms
13,824 KB
testcase_12 AC 110 ms
15,232 KB
testcase_13 AC 105 ms
14,080 KB
testcase_14 AC 111 ms
15,104 KB
testcase_15 AC 106 ms
13,696 KB
testcase_16 AC 102 ms
13,824 KB
testcase_17 AC 108 ms
13,696 KB
testcase_18 AC 111 ms
15,232 KB
testcase_19 AC 107 ms
13,696 KB
testcase_20 AC 106 ms
13,824 KB
testcase_21 AC 89 ms
12,288 KB
testcase_22 AC 112 ms
14,848 KB
testcase_23 AC 96 ms
12,672 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def integer_string? str
  Integer(str)
  true
rescue ArgumentError
  false
end
list = gets.chomp.split("")
sum = 0
list.each do |val|
	sum += val.to_i if integer_string? val
end
puts sum
0