-4
當我運行這個程序,我得到錯誤:意外結束輸入,期待keyword_end
(repl):17: syntax error, unexpected end-of-input, expecting keyword_end
i = 0
numbers = []
while i < 100
if i%3 == 0 and i%5 == 0
numbers.push('FizzBuzz')
else if i%3 == 0
numbers.push('Fizz')
else if i%5 == 0
numbers.push('Buzz')
else
numbers.push(i)
end
i += 1
end
numbers.each do |number|
puts number
end
提示:'別人if',檢查你的Ruby語法文檔。 –
tnx求助^ - ^ –