commit 721ad431270886cb85748935e65b90de04001286 Author: Wind-Explorer Date: Fri Sep 11 12:21:09 2026 +0800 init diff --git a/auditor.py b/auditor.py new file mode 100644 index 0000000..a0a6e88 --- /dev/null +++ b/auditor.py @@ -0,0 +1,36 @@ +inventory = 0 +total_units = 0 +failed = 0 + +print("=== Stock Auditor ===") +print("Type 'quit' to exit.\n") + +while True: + user_input = input("Enter stock quantity: ").strip() + + if user_input.lower() == "quit": + break + + if not user_input.isdigit(): + print("Error: Invalid input. Please enter a positive integer.\n") + failed += 1 + continue + + quantity = int(user_input) + + if quantity < 0: + print("Error: Negative numbers are not allowed.\n") + failed += 1 + continue + + inventory += quantity + total_units += quantity + print(f"Stock added. Current inventory: {inventory}\n") + + if inventory > 500: + print(f"ALERT: Overstock detected! Inventory ({inventory}) exceeds 500 units.") + break + +print("\n--- Audit Report ---") +print(f"Total Units Processed: {total_units}") +print(f"Failed/Rejected Entries: {failed}")