結果

問題 No.56 消費税
ユーザー マサ
提出日時 2022-02-10 23:10:39
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 474 bytes
コンパイル時間 2,227 ms
コンパイル使用メモリ 76,028 KB
実行使用メモリ 56,580 KB
最終ジャッジ日時 2024-06-26 06:36:23
合計ジャッジ時間 7,057 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 17 WA * 6
権限があれば一括ダウンロードができます

ソースコード

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