結果
問題 | No.56 消費税 |
ユーザー |
![]() |
提出日時 | 2016-01-12 23:23:56 |
言語 | Java (openjdk 23) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 903 bytes |
コンパイル時間 | 3,263 ms |
コンパイル使用メモリ | 74,312 KB |
実行使用メモリ | 50,416 KB |
最終ジャッジ日時 | 2024-07-18 03:02:54 |
合計ジャッジ時間 | 4,839 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 WA * 1 |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; //No.56 消費税 public class ConsumptionTax { public static void main(String[] args) throws IOException { // TODO 自動生成されたメソッド・スタブ //入力された価格 int price; //消費税率 int taxrate; //入力値 String input; //実際の価格 int realPrice; //消費税額 double taxPrice; BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); input = in.readLine(); //入力値を分割してpriceとtaxrateに格納する。 String[] temp = input.split(" "); price = Integer.parseInt(temp[0]); taxrate = Integer.parseInt(temp[1]); //消費税額を計算 taxPrice = Math.floor((taxrate * 0.01) * price); //実際の価格を計算 realPrice = price + (int)taxPrice; System.out.println(realPrice); } }