Ruby Examples
This commit is contained in:
10
level5/41.rb
Executable file
10
level5/41.rb
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/ruby
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
=begin
|
||||
map을 사용해 배열의 제곱값 배열 생성
|
||||
=end
|
||||
|
||||
array = [2, 3, 5, 7, 9]
|
||||
|
||||
puts array.map { |item| item ** 2 }
|
||||
Reference in New Issue
Block a user