結果

問題 No.289 数字を全て足そう
ユーザー rky
提出日時 2017-10-28 13:14:31
言語 Ruby
(3.4.1)
結果
AC  
実行時間 112 ms / 1,000 ms
コード長 186 bytes
コンパイル時間 41 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 15,104 KB
最終ジャッジ日時 2024-11-22 03:14:46
合計ジャッジ時間 3,461 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
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