Stock-order processing
在庫注文処理
**IGCSE 0478 · アルゴリズム記述
以下の問題を読み、サポートを開く前に解答を試みよ。指定された入出力契約を使用すること。チェックは複数の独立したケースを実行し、サンプル出力1つだけでは不十分である。
難易度 5/5 · 400 コイン + 今日初回達成時の小ボーナス
Stock is 9. Requests are 4, 0, 6, 5. A positive request is accepted only if it fits. Give Stock after each request.
難易度 5/5 · 400 コイン + 今日初回達成時の小ボーナス
With Stock = 5, valid request quantities are 1 to 5. Give four boundary test quantities in ascending order, including just-outside values.
難易度 5/5 · 400 コイン + 今日初回達成時の小ボーナス
Read initial Stock (non-negative), NumberOfRequests (1 to 6), then NumberOfRequests requested quantities. A request must be positive and no greater than current Stock. For each request output accepted and subtract it, or rejected and leave Stock unchanged. Finally output Stock.
実行ボタンをクリックして出力を確認してください。