小编Thi*_*ker的帖子

为什么我不能在Ruby中运行代码?

我的代码是:

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

-3
推荐指数
1
解决办法
52
查看次数

标签 统计

ruby ×1