Create a program that draws a multiplication table containing the numbers received from the standard input.
The input consists of positive integers. The integers are separated by newline characters. The length of the input data is not restricted, but it is guaranteed that the square of the largest integer is not greater than the numbers we can store in a variable of type int.
The output consists of a multiplication table where each line is terminated by a newline and the numbers are separated by spaces. The ith number of the jth line contains the product of the ith and jth integers of the input. The table contains no headings.
Output for Sample Input
Hints and Guide
Because of the length of the input was not specified, the best solution is to create a linked list to store the input data.
The implementation of a linked list requires a record type with two fields: an integer and a pointer to the next item. We will use the linked list as a queue, hence both the first and the last member should be referenced with pointers.
One possible solution is available in: main.c.
Acknowledgement This work was supported by the construction EFOP-3.4.3-16-2016-00021. The project was supported by the European Union, co-financed by the European Social Fund.
|University of Debrecen; Faculty of Informatics; v. 03/01/2019|