def pyramid(n) (0...n).each do |i| (n - i).times { print "#{n}" } puts end end pyramid(gets.to_i)