結果
問題 |
No.56 消費税
|
ユーザー |
![]() |
提出日時 | 2021-02-18 00:41:20 |
言語 | TypeScript (5.7.2) |
結果 |
WA
|
実行時間 | - |
コード長 | 416 bytes |
コンパイル時間 | 8,823 ms |
コンパイル使用メモリ | 228,228 KB |
実行使用メモリ | 41,328 KB |
最終ジャッジ日時 | 2024-12-31 16:27:41 |
合計ジャッジ時間 | 10,957 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 4 |
other | WA * 23 |
ソースコード
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);