Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(ASAP) Beginner C++ Programming: Write a simple program to solve the task and give the exactly same output, as in the example. (ASAP) The task

(ASAP) Beginner C++ Programming: Write a simple program to solve the task and give the exactly same output, as in the example. (ASAP)

The task is to write a code, that produces EXACTLY the same output format in case of the given input, as in the example. Look at the EXAMPLEs down below, and it will help to understand.

Please use ONLY simple algoritms, data structures. The STL library algorithms and data structures are NOT allowed. It must not be difficult, think about very simple algoritms, like sorting with loops and else-if statements for example. Only little time must be enough and hopefully not too many lines.

Task:

A library stores the following information about purchases: book code, theme code, year of purchase, number of pieces purchased. Data series are in ascending order by year.

Standard input:

Number of book purchases are in the first line of standard input (1N1000). This is followed by the library information about getting the books, line by line. The purchase lines contain the data in the following order: book code (0BCode100000), theme code (0TCode100), year (0Year100), number of pieces (1Pc100).

Standard output:

A line with a single # character must be written to the standard output before the result of each subtask, followed by one or more lines containing the result of the subtask! If you can't solve a subtask, you just have to write the # character! If the output does not meet this requirement in form (e.g. fewer/more # characters), the evaluator will send an "Output format error" message (even if there is a correct subtask solution).

Subtask 1: The first line should be the year in which you have the least, but at least 1 book acquired into the library! In an unclear case, the earliest year is the correct answer.

Subtask 2: The first row should include the number of years in which the library was and then in the second row, an ascending list of each year!

Example Input:

6 1 11 10 3 2 22 10 2 2 22 11 4 1 11 18 9 4 4 19 1 11 11 25 3

Example Output:

# 19 # 5 10 11 18 19 25 #

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions

Question

If you were Akio, what would you do now?

Answered: 1 week ago