結果
| 問題 | No.784 「,(カンマ)」 |
| コンテスト | |
| ユーザー |
object1234
|
| 提出日時 | 2019-02-10 10:09:09 |
| 言語 | Ruby (4.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 238 bytes |
| 記録 | |
| コンパイル時間 | 69 ms |
| コンパイル使用メモリ | 9,088 KB |
| 実行使用メモリ | 15,104 KB |
| 最終ジャッジ日時 | 2026-03-27 04:22:04 |
| 合計ジャッジ時間 | 1,834 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 WA * 3 |
コンパイルメッセージ
Syntax OK
ソースコード
a = gets.chomp.chars
count = 0
(a.length - 1).downto(0) do |i|
count += 1 if a[i] =~ /[0-9]/
if count == 3 and i - 1 > 0
a[i + 1..a.length] = a[i..a.length - 1]
a[i] = ","
count = 0
end
end
puts a.join
object1234