結果

問題 No.56 消費税
ユーザー cheeeesecheeeese
提出日時 2021-06-28 13:20:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 424 bytes
コンパイル時間 1,871 ms
コンパイル使用メモリ 72,052 KB
実行使用メモリ 57,948 KB
最終ジャッジ日時 2023-09-07 18:22:48
合計ジャッジ時間 6,272 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,844 KB
testcase_01 AC 123 ms
55,864 KB
testcase_02 AC 121 ms
56,068 KB
testcase_03 AC 122 ms
54,112 KB
testcase_04 AC 116 ms
56,028 KB
testcase_05 AC 118 ms
56,028 KB
testcase_06 AC 120 ms
56,172 KB
testcase_07 AC 120 ms
56,164 KB
testcase_08 AC 121 ms
55,888 KB
testcase_09 AC 119 ms
55,504 KB
testcase_10 AC 120 ms
57,948 KB
testcase_11 AC 118 ms
55,756 KB
testcase_12 AC 119 ms
56,224 KB
testcase_13 AC 120 ms
55,740 KB
testcase_14 AC 120 ms
56,524 KB
testcase_15 AC 119 ms
56,036 KB
testcase_16 AC 120 ms
56,528 KB
testcase_17 AC 119 ms
55,660 KB
testcase_18 AC 123 ms
56,100 KB
testcase_19 AC 120 ms
56,300 KB
testcase_20 AC 123 ms
56,060 KB
testcase_21 AC 121 ms
55,940 KB
testcase_22 AC 119 ms
55,908 KB
testcase_23 AC 121 ms
55,920 KB
testcase_24 AC 121 ms
55,928 KB
testcase_25 AC 120 ms
56,028 KB
testcase_26 AC 119 ms
53,912 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main (String[] args) {
		Scanner scanner = new Scanner(System.in);
		int D = scanner.nextInt();
		double P = scanner.nextInt();

		if(D < 1 || D > Math.pow(10, 7) || P < 0 || P > 100) {
			System.out.println("Please enter a number between 1 and 10000000 for D, and between 0 and 100 for P.");
		} else {
			System.out.println((int)(D*(100+P))/100);
		}
	}
}
0