結果

問題 No.56 消費税
ユーザー yu0912yu0912
提出日時 2020-07-23 13:47:04
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 80 ms / 5,000 ms
コード長 413 bytes
コンパイル時間 31 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 42,384 KB
最終ジャッジ日時 2023-09-05 22:12:07
合計ジャッジ時間 3,314 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
42,312 KB
testcase_01 AC 75 ms
42,252 KB
testcase_02 AC 75 ms
42,084 KB
testcase_03 AC 76 ms
42,116 KB
testcase_04 AC 76 ms
42,240 KB
testcase_05 AC 76 ms
42,276 KB
testcase_06 AC 80 ms
42,208 KB
testcase_07 AC 77 ms
42,124 KB
testcase_08 AC 78 ms
42,220 KB
testcase_09 AC 76 ms
42,220 KB
testcase_10 AC 76 ms
42,384 KB
testcase_11 AC 77 ms
42,384 KB
testcase_12 AC 76 ms
42,228 KB
testcase_13 AC 76 ms
42,136 KB
testcase_14 AC 79 ms
42,160 KB
testcase_15 AC 78 ms
42,312 KB
testcase_16 AC 77 ms
42,280 KB
testcase_17 AC 77 ms
42,272 KB
testcase_18 AC 78 ms
42,208 KB
testcase_19 AC 76 ms
42,088 KB
testcase_20 AC 76 ms
42,284 KB
testcase_21 AC 77 ms
42,320 KB
testcase_22 AC 76 ms
42,172 KB
testcase_23 AC 78 ms
42,132 KB
testcase_24 AC 76 ms
42,292 KB
testcase_25 AC 75 ms
42,308 KB
testcase_26 AC 77 ms
42,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

function main(input = ``) {
  let lines = input.split('\n');

  let [price, taxRate] = lines[0].split(' ').map((val) => parseInt(val));

  return `${Math.floor((price * (1 + taxRate / 100)).toFixed(2))}`;
}

const { readFileSync, existsSync } = require('fs');
const stdin = '/dev/stdin';

if (existsSync(stdin)) {
  const input = readFileSync(stdin, 'utf8');
  console.log(main(input));
}

module.exports = main;
0