-3
我是Ruby的新學習者。我也試過打印「輸入字符」a =如果(a =='b')放「b被按下」結束
print "Enter a character "
a = gets
if (a == "b")
puts "b was pressed"
end
而這也
print "Enter a character "
a = gets.to_s
if (a == 'b')
puts "b was pressed"
end