LoginSignup
2
1

精度の高い小数点の計算プログラムを作りました

# 自分の得意な言語で
# Let's チャレンジ!!
input_line = gets
array1 = input_line.split(' ')
M = array1[0].to_f
p1 = array1[1].to_f
q1 = array1[2].to_f
ans1 = (M * p1 / 100).to_f
ans2 = (M - ans1).to_f
ans3 = (ans2 * q1 / 100).to_f
ans4 = (ans2 -ans3).to_f
puts ans4
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1