We walk and learn
Ruby version: 2.3.0
irb> print "hello\t", "world", 100, "100"
hello world100100=> nil
irb> puts "hello\t", "world", 100, "100"
hello
world
100
100
=> nil
irb> p "hello\t", "world", 100, "100"
"hello\t"
"world"
100
"100"
=> ["hello\t", "world", 100, "100"]
# encoding: 编码方式
,这种注释被称为魔法注释。-E 编码方式
选项,如ruby -E hello.rb
。x = 10
y = 10
print "面积 = #{(x * y)}\n"
#
表示注释的开始。=begin
和=end
表示注释的开始和结束。if .. then .. else .. end
。while .. do .. end
。n.times do .. end
。