結果

問題 No.32 貯金箱の憂鬱
ユーザー ant2357ant2357
提出日時 2016-03-23 23:25:08
言語 PHP
(8.3.4)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 461 bytes
コンパイル時間 1,081 ms
コンパイル使用メモリ 18,460 KB
実行使用メモリ 18,928 KB
最終ジャッジ日時 2023-09-30 08:04:16
合計ジャッジ時間 1,014 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
18,872 KB
testcase_01 AC 15 ms
18,780 KB
testcase_02 AC 16 ms
18,824 KB
testcase_03 AC 16 ms
18,876 KB
testcase_04 AC 15 ms
18,720 KB
testcase_05 AC 15 ms
18,744 KB
testcase_06 AC 15 ms
18,872 KB
testcase_07 AC 16 ms
18,856 KB
testcase_08 AC 15 ms
18,928 KB
testcase_09 AC 15 ms
18,800 KB
testcase_10 AC 16 ms
18,736 KB
testcase_11 AC 15 ms
18,736 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
//100円硬貨
$l = trim(fgets(STDIN) * 100);
//25円硬貨
$m = trim(fgets(STDIN) * 25);
//1円硬貨
$n = trim(fgets(STDIN));

//合計金額を算出
$totalPrice = $l + $m + $n;

//100円硬貨の枚数を取得
$totalPrice %= 1000;
$lCoin = floor($totalPrice / 100);

//25円硬貨の枚数を取得
$totalPrice %= 100;
$mCoin = floor($totalPrice / 25);

//1円硬貨の枚数を取得
$totalPrice %= 25;

//出力
echo($mCoin + $lCoin + $totalPrice);
0