我想使这个简单的程序,通过选择单位返回重量数量。当我运行该程序就没有问题运行,并询问这两个问题在if
但不会返回value
不能输出结果后如果
这里是我的代码:
puts "What is your starting weight and ratio unit?
1:kg.m/h
2:gm.m/s
3:mm.m/s"
inputing_unit = gets.chomp
puts "What is your ending weight and ratio unit?
1:kg.m/h
2:gm.m/s
3:mm.m/s"
ending_unit = gets.chomp
if inputing_unit == 1 and ending_unit == 1 then
puts "What is your weight?"
input_weight = gets.chomp.to_i
puts "What is your ratio?"
input_ratio = gets.chomp.to_i
puts "Your moving value is #{input weight * input_ratio}"
end
邮编,而不是图像的代码 –
显示显示您的代码... –
我是新来的网站抱歉的延误。 –