結果

問題 No.56 消費税
ユーザー マサマサ
提出日時 2022-02-10 23:10:39
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 474 bytes
コンパイル時間 2,357 ms
コンパイル使用メモリ 72,372 KB
実行使用メモリ 58,040 KB
最終ジャッジ日時 2023-09-08 13:23:49
合計ジャッジ時間 7,548 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
56,084 KB
testcase_01 AC 128 ms
54,208 KB
testcase_02 AC 128 ms
55,892 KB
testcase_03 AC 130 ms
56,044 KB
testcase_04 AC 127 ms
56,296 KB
testcase_05 AC 129 ms
56,076 KB
testcase_06 AC 130 ms
55,784 KB
testcase_07 AC 127 ms
55,948 KB
testcase_08 AC 129 ms
56,204 KB
testcase_09 AC 128 ms
55,684 KB
testcase_10 AC 130 ms
56,300 KB
testcase_11 AC 129 ms
56,112 KB
testcase_12 AC 129 ms
55,752 KB
testcase_13 AC 128 ms
56,100 KB
testcase_14 AC 129 ms
56,148 KB
testcase_15 AC 132 ms
55,728 KB
testcase_16 AC 129 ms
56,100 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 128 ms
55,840 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 128 ms
55,680 KB
testcase_25 AC 128 ms
56,188 KB
testcase_26 AC 128 ms
56,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigDecimal;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int d = sc.nextInt();
		int p = sc.nextInt();
		
		double taxRate = 1 + (double)p / 100;
		
		BigDecimal bd1 = new BigDecimal(Integer.toString(d));
		BigDecimal bd2 = new BigDecimal(Double.toString(taxRate));
		BigDecimal result = bd1.multiply(bd2);
		
		System.out.println(result.intValue());
		
		sc.close();
	}
}
0