結果

問題 No.56 消費税
ユーザー megane_ankomegane_anko
提出日時 2021-02-18 00:42:05
言語 TypeScript
(5.4.3)
結果
AC  
実行時間 77 ms / 5,000 ms
コード長 418 bytes
コンパイル時間 7,663 ms
コンパイル使用メモリ 253,508 KB
実行使用メモリ 42,628 KB
最終ジャッジ日時 2023-10-12 10:20:03
合計ジャッジ時間 9,788 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
42,220 KB
testcase_01 AC 75 ms
42,076 KB
testcase_02 AC 75 ms
42,208 KB
testcase_03 AC 75 ms
42,236 KB
testcase_04 AC 75 ms
42,212 KB
testcase_05 AC 75 ms
42,208 KB
testcase_06 AC 75 ms
42,208 KB
testcase_07 AC 76 ms
42,076 KB
testcase_08 AC 75 ms
42,268 KB
testcase_09 AC 74 ms
42,104 KB
testcase_10 AC 76 ms
42,240 KB
testcase_11 AC 76 ms
42,628 KB
testcase_12 AC 75 ms
42,048 KB
testcase_13 AC 75 ms
42,052 KB
testcase_14 AC 76 ms
42,244 KB
testcase_15 AC 74 ms
42,292 KB
testcase_16 AC 77 ms
42,072 KB
testcase_17 AC 76 ms
42,052 KB
testcase_18 AC 75 ms
42,296 KB
testcase_19 AC 76 ms
42,232 KB
testcase_20 AC 75 ms
42,264 KB
testcase_21 AC 75 ms
42,068 KB
testcase_22 AC 75 ms
42,228 KB
testcase_23 AC 76 ms
42,232 KB
testcase_24 AC 75 ms
42,104 KB
testcase_25 AC 75 ms
42,076 KB
testcase_26 AC 76 ms
42,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import * as fs from 'fs';
const input = fs.readFileSync('/dev/stdin', 'utf8');

const arr = input.split(' ');
let D = parseInt(arr[0]);
let p = parseInt(arr[1]) / 100;
//console.log(p);

//定価 * 消費税の小数点以下切りすて
//console.log(D * (1 + p));//この小数点処理ができず詰んだ
//let result = Math.floor(D * (1 + p));
let result = Math.floor(D + D * 100 * p / 100);
console.log(result);
0