input = readlines
#input
# 120
# 115
# 122
# 116
# 119
# 117
puts input
#Output result
# 120
# 115
# 122
# 116
# 119
# 117
You can receive multiple lines with the readlines
method
input = readlines.map &:chomp
#input
# 120
# 115
# 122
# 116
# 119
# 117
print input
#Output result
# ["120", "115", "122", "116", "119", "117"]
puts input
#Output result
# 120
# 115
# 122
# 116
# 119
-Chop method: Removes line breaks in character strings. -Convert elements to integers with the map method