# 入力された値を文字列で受け取る str = gets.chomp # String#* で入力値分だけ "Long" を結合する puts "Long" * str.to_i