結果

問題 No.56 消費税
ユーザー villachvillach
提出日時 2017-10-13 17:47:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 5,000 ms
コード長 386 bytes
コンパイル時間 3,031 ms
コンパイル使用メモリ 72,504 KB
実行使用メモリ 56,488 KB
最終ジャッジ日時 2023-08-11 00:22:46
合計ジャッジ時間 7,590 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,392 KB
testcase_01 AC 118 ms
55,972 KB
testcase_02 AC 119 ms
55,680 KB
testcase_03 AC 122 ms
55,388 KB
testcase_04 AC 121 ms
54,128 KB
testcase_05 AC 119 ms
56,352 KB
testcase_06 AC 119 ms
55,724 KB
testcase_07 AC 119 ms
55,708 KB
testcase_08 AC 122 ms
55,972 KB
testcase_09 AC 121 ms
55,900 KB
testcase_10 AC 121 ms
55,932 KB
testcase_11 AC 120 ms
55,688 KB
testcase_12 AC 118 ms
55,848 KB
testcase_13 AC 117 ms
55,956 KB
testcase_14 AC 119 ms
56,304 KB
testcase_15 AC 120 ms
56,028 KB
testcase_16 AC 119 ms
55,736 KB
testcase_17 AC 120 ms
56,212 KB
testcase_18 AC 120 ms
56,136 KB
testcase_19 AC 119 ms
55,868 KB
testcase_20 AC 116 ms
56,488 KB
testcase_21 AC 116 ms
55,708 KB
testcase_22 AC 119 ms
55,924 KB
testcase_23 AC 121 ms
55,512 KB
testcase_24 AC 119 ms
55,676 KB
testcase_25 AC 118 ms
55,772 KB
testcase_26 AC 122 ms
56,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class N56 {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		double d = sc.nextInt();
		double p = sc.nextInt();
		double hoge = d * (1 + p*0.01);
		if(hoge - Math.floor(hoge) > 0.9999){
			hoge = Math.floor(hoge) + 1;
		}else{
			hoge = Math.floor(hoge);
		}
		System.out.println((int) hoge);
	}
}
0