結果

問題 No.56 消費税
ユーザー yo-kondoyo-kondo
提出日時 2018-03-24 22:25:52
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 292 ms / 5,000 ms
コード長 597 bytes
コンパイル時間 11,514 ms
コンパイル使用メモリ 428,176 KB
実行使用メモリ 57,240 KB
最終ジャッジ日時 2024-04-30 17:27:45
合計ジャッジ時間 17,554 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 268 ms
57,144 KB
testcase_01 AC 262 ms
57,048 KB
testcase_02 AC 261 ms
57,108 KB
testcase_03 AC 268 ms
57,108 KB
testcase_04 AC 257 ms
57,080 KB
testcase_05 AC 265 ms
57,032 KB
testcase_06 AC 267 ms
57,028 KB
testcase_07 AC 274 ms
57,028 KB
testcase_08 AC 287 ms
57,000 KB
testcase_09 AC 280 ms
57,136 KB
testcase_10 AC 273 ms
57,012 KB
testcase_11 AC 292 ms
57,036 KB
testcase_12 AC 286 ms
57,032 KB
testcase_13 AC 283 ms
57,096 KB
testcase_14 AC 286 ms
57,076 KB
testcase_15 AC 281 ms
57,024 KB
testcase_16 AC 265 ms
56,992 KB
testcase_17 AC 263 ms
57,032 KB
testcase_18 AC 288 ms
57,100 KB
testcase_19 AC 271 ms
57,112 KB
testcase_20 AC 263 ms
57,084 KB
testcase_21 AC 262 ms
57,048 KB
testcase_22 AC 271 ms
57,240 KB
testcase_23 AC 264 ms
57,120 KB
testcase_24 AC 265 ms
56,976 KB
testcase_25 AC 268 ms
56,980 KB
testcase_26 AC 279 ms
57,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:7:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

package yukicoder.no56

/**
 * エントリポイント
 * @param args コマンドライン引数
 */
fun main(args: Array<String>) {
    val in1 = readLine()
    println(consumptionTax(in1))
}

/**
 * 商品の金額と税率をもとに、合計金額を返します。
 * @param amountAndTaxRate 商品の金額と税率
 * @return 合計金額
 */
fun consumptionTax(amountAndTaxRate: String?): String {
    if (amountAndTaxRate == null) {
        return ""
    }

    val sp = amountAndTaxRate.split(" ").map { it.toDouble() }
    return (sp[0] + sp[0] * (sp[1] / 100)).toInt().toString()
}
0