formatter="%s %s %s %s"putsformatter%[1,2,3,4]putsformatter%["one","two","three","four"]putsformatter%[true,false,false,true]putsformatter%[formatter,formatter,formatter,formatter]putsformatter%["I had this thing.","That you could type up right.","But it didn't sing.","So I said goodnight."]
你應該看到的結果
$ ruby ex8.rb
1 2 3 4
one two three four
true false false true
%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s
I had this thing. That you could type up right. But it didn't sing. So I said goodnight.
$