Home>
p 1 + eval (gets.split *?-)
  • Answer # 1

    p 1 + eval (gets.split *?-)

    evalexecutes a string as Ruby code.
    getsis reading input.
    splitsplits a string into an array. If no argument is given, split with whitespace.
    *is the same asjoin. I rarely see Array*.
    ?is a character literal.?-means"-".

    If you enter

    15 3

    1 + eval (["15", "3"]. join ("-"))


    Will be output asp.