A waiter in a staff restaurant receives meal vouchers from customers and once read, the receipts are pinned on a vertical spindle. If a ticket has to be removed for checking, all the top tickets have to be removed sequentially before returning back. Write an algorithm to represent the pinning and removal of receipts from customers. Implement your algorithm in either C or C++.
Please fix the following input errors: