Question
Student Database Jojo just landed an internship at his university. His first internship task is to design a basic database system that is capable of
Student Database
Jojo just landed an internship at his university. His first internship task is to design a basic database system that is capable of storing and retrieving student information.
Jojo will first be given the ID, name, and age of N students sequentially. Jojos database system needs to answer Q queries X1,X2,X3,...XQ. Each query needs to be answered by outputting the data of the Xi-th student.
Unfortunately, Jojo is very lazy. As a good friend of his, you need to help him finish this task in order to prevent Jojos laziness from ending his internship prematurely!
Format Input The first line contains a single integer N, the number of students which Jojo will be given the data of. The next 3 N lines contain the following, each in their own line: IDi, the ID of the i-th student Namei, the name of the i-th student. Agei, the age of the i-th student
The next line will contain a single integer Q, the number of queries Jojo needs to answer. Each of the next Q lines will contain a single integer Xi, the contents of each query as described in the problem statement.
Format Output For each query, output Query # i: without quotes on the first line where i is the number of the query, then output the data if the Xi-th student using the following format:
ID:
Contstraints 1 N, Q 1000 1 |IDi| 20 1 |Namei| 100 1 Agei 50 IDi contains only numbers. Namei contains only alphabetical ASCII characters and spaces.
Sample Input (standard input) 2 01337 Lili Lili 18 69420 Bibi 20 2 2 1
Sample Output (standard output) Query #1: ID: 69420 Name: Bibi Age: 20 Query #2: ID: 01337 Name: Lili Lili Age: 18
Language : C
Do with stdio.h library !
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started