#K6836. Library Inventory Management
Library Inventory Management
Library Inventory Management
You are given a simulation of a library inventory management system. The system supports three operations:
-
Add a book: Use a query in the format
0 x "title"
, where x is the unique integer identifier and title is the book title (enclosed in double quotes). This operation adds the book to the inventory. -
Remove a book: Use a query in the format
1 x
to remove the book with identifier x from the inventory. -
Find a book: Use a query in the format
2 x
to find the title of the book with identifier x. If the book is not found, output "Not found".
The operations are executed sequentially. For each find operation (type 2), you must output the result (book title or "Not found") on a new line.
All input is read from standard input (stdin) and all output is printed to standard output (stdout).
Note: If any mathematical expressions are needed, use LaTeX format (for example, ).
inputFormat
The first line contains an integer — the number of queries. Each of the following lines contains a query in one of the following formats:
- For adding a book:
0 x "title"
. - For removing a book:
1 x
. - For finding a book:
2 x
.
Here, is an integer representing the book identifier, and "title" is a string (which may contain spaces) enclosed in double quotes. The input is provided via standard input (stdin).
outputFormat
For every find query (type 2), print the title of the book if it exists in the inventory; otherwise, print "Not found". Each result should be printed on a new line on standard output (stdout).## sample
6
0 1001 "Pride and Prejudice"
0 1002 "War and Peace"
0 1003 "1984"
2 1002
1 1003
2 1003
War and Peace
Not found
</p>