結果

問題 No.56 消費税
ユーザー cheeeesecheeeese
提出日時 2021-06-28 13:32:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 421 bytes
コンパイル時間 2,028 ms
コンパイル使用メモリ 72,296 KB
実行使用メモリ 57,712 KB
最終ジャッジ日時 2023-09-07 18:23:52
合計ジャッジ時間 6,509 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,856 KB
testcase_01 AC 119 ms
55,712 KB
testcase_02 AC 121 ms
55,916 KB
testcase_03 AC 121 ms
55,424 KB
testcase_04 AC 125 ms
55,904 KB
testcase_05 AC 121 ms
56,116 KB
testcase_06 AC 121 ms
55,856 KB
testcase_07 AC 121 ms
56,168 KB
testcase_08 AC 122 ms
56,004 KB
testcase_09 AC 122 ms
55,828 KB
testcase_10 AC 124 ms
56,184 KB
testcase_11 AC 121 ms
55,932 KB
testcase_12 AC 121 ms
55,644 KB
testcase_13 AC 122 ms
55,696 KB
testcase_14 AC 121 ms
57,712 KB
testcase_15 AC 121 ms
55,576 KB
testcase_16 AC 122 ms
56,032 KB
testcase_17 AC 120 ms
55,968 KB
testcase_18 AC 121 ms
55,980 KB
testcase_19 AC 121 ms
55,772 KB
testcase_20 AC 118 ms
55,424 KB
testcase_21 AC 119 ms
56,104 KB
testcase_22 AC 120 ms
55,748 KB
testcase_23 AC 120 ms
56,052 KB
testcase_24 AC 119 ms
53,740 KB
testcase_25 AC 121 ms
55,712 KB
testcase_26 AC 122 ms
56,264 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();
		int 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