我的代码是:
lineWidth = 40
str1 = 'Content'
str2 = 'page1'
chapter1 = 'Chapter 1: Numbers'
puts str1.center lineWidth
puts chapter1.ljust (lineWidth/2) + str2.rjust (lineWidth/2)
Run Code Online (Sandbox Code Playgroud)
在控制台中启动后我有一个错误:
calc.rb:7: syntax error, unexpected ( arg, expecting end-of-input
puts chapter1.ljsut (lineWidth/2) + chapter1.rjsut (lineWidth/2)
Run Code Online (Sandbox Code Playgroud)
怎么了?
ruby ×1