#K60302. Employee Search by Last Name
Employee Search by Last Name
Employee Search by Last Name
You are given data about employees, where each employee has a first_name
, last_name
, age
, and position
. The input begins with an integer n representing the number of employees. This is followed by n lines, each containing the details of an employee separated by spaces. The last line of input contains a last name to search for. Your task is to output the details of all employees whose last name exactly matches the given search term.
If no employee matches the search criteria, output the following message:
inputFormat
The first line contains an integer n ($$1 \leq n \leq 10^5$$), the number of employees. Each of the next n lines contains four space-separated values: first_name
, last_name
, age
, and position
.
The final line contains the last name to search for.
outputFormat
If at least one employee has the matching last name, output each matching employee's details on a separate line in the order they appear in the input. Each line should have the format:
If no employee matches the given last name, output:
$$No\ employees\ with\ that\ last\ name\ found.$$## sample3
John Doe 30 Manager
Alice Smith 28 Developer
Bob Doe 25 Designer
Doe
John Doe 30 Manager
Bob Doe 25 Designer
$$