Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def square_of_sum (my_array, proc_sum_numbers_name, proc_square_numbers_name)
- sum = proc_sum_numbers_name.call(my_array)
- proc_square_numbers_name.call(sum)
- end
- my_array = gets.split().map(&:to_i)
- proc_sum_array = proc{|x| x.reduce(0, :+) }
- proc_square_number = proc{|x| x ** 2 }
- puts square_of_sum(my_array, proc_sum_array, proc_square_number)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement