ruby-uebungen/Assignment_017/solution/readme.md

11 lines
116 B
Markdown

# Lösung: Vararg-Methoden
```ruby
def produkt(*p)
p.reduce { |s, e| s *= e }
end
puts produkt(5, 7, 8, 1)
```