我想使這個簡單的程序,通過選擇單位返回重量數量。當我運行該程序就沒有問題運行,並詢問這兩個問題在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
郵編,而不是圖像的代碼 –
顯示顯示您的代碼... –
我是新來的網站抱歉的延誤。 –