結果
| 問題 | 
                            No.784 「,(カンマ)」
                             | 
                    
| コンテスト | |
| ユーザー | 
                             object1234
                         | 
                    
| 提出日時 | 2019-02-10 10:09:09 | 
| 言語 | Ruby  (3.4.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 238 bytes | 
| コンパイル時間 | 49 ms | 
| コンパイル使用メモリ | 7,296 KB | 
| 実行使用メモリ | 12,288 KB | 
| 最終ジャッジ日時 | 2024-07-05 18:58:08 | 
| 合計ジャッジ時間 | 1,689 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| 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