結果

問題 No.56 消費税
ユーザー yu0912
提出日時 2020-07-23 13:46:03
言語 JavaScript
(node v23.5.0)
結果
WA  
実行時間 -
コード長 413 bytes
コンパイル時間 391 ms
コンパイル使用メモリ 5,632 KB
実行使用メモリ 39,552 KB
最終ジャッジ日時 2024-06-23 17:32:46
合計ジャッジ時間 2,832 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20 WA * 3
権限があれば一括ダウンロードができます

ソースコード

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(1))}`;
}

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