結果

問題 No.56 消費税
ユーザー villachvillach
提出日時 2017-10-13 17:47:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 5,000 ms
コード長 386 bytes
コンパイル時間 3,247 ms
コンパイル使用メモリ 77,616 KB
実行使用メモリ 41,436 KB
最終ジャッジ日時 2024-04-28 17:31:47
合計ジャッジ時間 7,506 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
40,012 KB
testcase_01 AC 126 ms
41,180 KB
testcase_02 AC 117 ms
40,884 KB
testcase_03 AC 115 ms
40,300 KB
testcase_04 AC 126 ms
41,160 KB
testcase_05 AC 128 ms
41,228 KB
testcase_06 AC 128 ms
41,040 KB
testcase_07 AC 126 ms
41,056 KB
testcase_08 AC 127 ms
41,160 KB
testcase_09 AC 124 ms
41,204 KB
testcase_10 AC 123 ms
41,316 KB
testcase_11 AC 114 ms
40,192 KB
testcase_12 AC 117 ms
40,568 KB
testcase_13 AC 125 ms
41,340 KB
testcase_14 AC 130 ms
41,304 KB
testcase_15 AC 130 ms
41,188 KB
testcase_16 AC 115 ms
39,792 KB
testcase_17 AC 124 ms
40,968 KB
testcase_18 AC 115 ms
39,916 KB
testcase_19 AC 126 ms
41,232 KB
testcase_20 AC 114 ms
40,096 KB
testcase_21 AC 128 ms
41,204 KB
testcase_22 AC 127 ms
41,408 KB
testcase_23 AC 127 ms
40,932 KB
testcase_24 AC 128 ms
41,068 KB
testcase_25 AC 132 ms
41,436 KB
testcase_26 AC 128 ms
41,208 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