結果

問題 No.56 消費税
ユーザー sjgq5302
提出日時 2017-07-18 22:55:42
言語 Ruby
(3.4.1)
結果
AC  
実行時間 88 ms / 5,000 ms
コード長 189 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-10-08 11:05:53
合計ジャッジ時間 3,700 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'bigdecimal'

input = gets.split(" ").map(&:to_f)
price = input[0]
tax = input[1]

puts BigDecimal((BigDecimal(price.to_s) * (BigDecimal((tax * 0.01).to_s) + 1)).to_s).to_f.floor(0)
0