fork(1) download
  1. number = 1
  2.  
  3. comment = if number % 3 == 0
  4. "3の倍数です。"
  5. elsif number % 3 == 1
  6. "3で割ると1余ります。"
  7. else
  8. "3で割ると2余ります。"
  9. end
  10.  
  11. print number.to_s + "は" + comment
Success #stdin #stdout 0.01s 6252KB
stdin
Standard input is empty
stdout
1は3で割ると1余ります。