結果

問題 No.56 消費税
ユーザー aparachia14aparachia14
提出日時 2016-01-12 23:23:56
言語 Java21
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 903 bytes
コンパイル時間 3,293 ms
コンパイル使用メモリ 71,380 KB
実行使用メモリ 49,864 KB
最終ジャッジ日時 2023-09-25 03:19:36
合計ジャッジ時間 5,780 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
49,076 KB
testcase_01 AC 45 ms
49,384 KB
testcase_02 AC 46 ms
49,236 KB
testcase_03 AC 45 ms
49,360 KB
testcase_04 AC 47 ms
49,292 KB
testcase_05 AC 46 ms
49,156 KB
testcase_06 AC 46 ms
49,268 KB
testcase_07 AC 43 ms
49,128 KB
testcase_08 AC 45 ms
49,508 KB
testcase_09 AC 47 ms
49,284 KB
testcase_10 WA -
testcase_11 AC 48 ms
49,284 KB
testcase_12 AC 46 ms
49,504 KB
testcase_13 AC 46 ms
49,600 KB
testcase_14 AC 45 ms
49,100 KB
testcase_15 AC 44 ms
49,084 KB
testcase_16 AC 46 ms
49,376 KB
testcase_17 AC 45 ms
49,236 KB
testcase_18 AC 45 ms
49,100 KB
testcase_19 AC 47 ms
49,552 KB
testcase_20 AC 48 ms
49,864 KB
testcase_21 AC 46 ms
49,196 KB
testcase_22 AC 45 ms
49,120 KB
testcase_23 AC 45 ms
49,228 KB
testcase_24 AC 45 ms
49,408 KB
testcase_25 AC 45 ms
49,396 KB
testcase_26 AC 47 ms
49,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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);

	}

}
0