#========================================
Put the gets method in the pattern 1 variable and output with puts
#========================================
n = gets
puts n
#========================================
Pattern 2 How to use stdin
#========================================
puts $stdin.gets
Standard input 2 4 7
#========================================
pattern 1
#========================================
#========================================
Pattern 2
#========================================
puts $stdin.readlines
readlines reads the multi-line value obtained by stdin as an "array".
You can also put it in a variable with n = $ stdin.readlines
and doputs n [0]
.
read.split
.Recommended Posts