結果

問題 No.56 消費税
ユーザー oyafusooyafuso
提出日時 2019-03-11 17:43:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 729 bytes
コンパイル時間 2,047 ms
コンパイル使用メモリ 72,276 KB
実行使用メモリ 56,068 KB
最終ジャッジ日時 2023-09-05 20:14:08
合計ジャッジ時間 6,576 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,912 KB
testcase_01 AC 123 ms
55,408 KB
testcase_02 AC 121 ms
55,620 KB
testcase_03 AC 122 ms
55,568 KB
testcase_04 AC 122 ms
55,524 KB
testcase_05 AC 120 ms
53,648 KB
testcase_06 AC 123 ms
55,832 KB
testcase_07 AC 123 ms
56,028 KB
testcase_08 AC 123 ms
55,420 KB
testcase_09 AC 123 ms
55,932 KB
testcase_10 AC 123 ms
55,576 KB
testcase_11 AC 124 ms
55,760 KB
testcase_12 AC 123 ms
56,068 KB
testcase_13 AC 124 ms
55,576 KB
testcase_14 AC 124 ms
55,708 KB
testcase_15 AC 122 ms
55,572 KB
testcase_16 AC 122 ms
55,696 KB
testcase_17 AC 121 ms
55,664 KB
testcase_18 AC 123 ms
55,732 KB
testcase_19 AC 123 ms
55,528 KB
testcase_20 AC 122 ms
53,932 KB
testcase_21 AC 120 ms
55,824 KB
testcase_22 AC 124 ms
55,416 KB
testcase_23 AC 123 ms
55,456 KB
testcase_24 AC 124 ms
55,756 KB
testcase_25 AC 122 ms
55,788 KB
testcase_26 AC 120 ms
55,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {

	private static final String SPLIT_STR = " ";

	public static void main(String[] args) {
		// Scanner生成
		Scanner sc = new Scanner(System.in);
		// 入力設定
		String input = sc.nextLine();
		String[] split = input.split(SPLIT_STR);
		List<Integer> numList = new ArrayList<>(split.length);
		for (int i = 0; i < split.length; i++) {
			numList.add(Integer.parseInt(split[i]));
		}
		// Scannerクローズ
		sc.close();

		/* メイン処理開始 */
		// 変数初期化
		int result = 0;
		int D = numList.get(0);
		int P = numList.get(1);
		// 結果設定
		result = (int)(D + D * (double)P / 100);
		/* メイン処理終了 */

		// 結果出力
		System.out.println(result);
	}
}
0