Stock-order processing
재고 주문 처리
**IGCSE 0478 · 알고리즘 작성
아래 문제를 읽고 해본 뒤 지원 기능을 열지 마십시오. 지정된 입력/출력 계약을 따르십시오. 여러 독립적인 테스트 케이스를 실행하며, 하나의 샘플 출력만으로는 충분하지 않습니다.
난이도 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.
출력을 보려면 '실행'을 클릭하세요.