単位を選択して重量を返すこの簡単なプログラムを作成します。私はプログラムを実行すると、それは問題なく動作し、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
コードの画像ではありません。 –
show show your code ... –
私は遅れて申し訳ありません。 –