結果
問題 |
No.289 数字を全て足そう
|
ユーザー |
|
提出日時 | 2017-07-03 20:31:20 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 100 ms / 1,000 ms |
コード長 | 186 bytes |
コンパイル時間 | 193 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 15,104 KB |
最終ジャッジ日時 | 2024-10-05 12:35:45 |
合計ジャッジ時間 | 2,951 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
コンパイルメッセージ
Syntax OK
ソースコード
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