I need a hand with a program

Hello, I need to write this program

a) The first two numbers indicate the size of the matrix - rows, columns, the next numbers in the quantity being the product of the number of rows and columns are the elements of the matrix arranged in rows.
b) The next matrix is ​​saved immediately after the previous one.
c) After each pair of matrices there is a text operator indicating what operation on
two preceding matrices should be made - valid values ​​are +, -, *.
d) The input file can contain any number of operations on matrix pairs
by repeating blocks consisting of 2 matrices and an operator.
e) The program sequentially loads matrix pairs and performs the indicated operations by checking
at the same time whether they are possible. If the operation is impossible, it is printed
incorrect data message and the program continues working.
f) The program should be divided into functions, including the function (s) responsible for
performing calculations on matrices.
g) The result of subsequent operations is printed to the standard output in the same form
as used in the input file.

for example

23
123456
32
654321
*




but have no clue what to do with it :( . Could someone help me ?
Looks like your classmate is doing the same exercise (although he/she didn't give enough information).
http://www.cplusplus.com/forum/general/266190/#msg1145782
the format of your examples is wrong.
23 (23 rows)
123456(123456 columns?)
and the 23*123456 data segment is missing. where are all the values? also, consider using a smaller example, that is a lot of numbers.
I assume it's supposed to be:

23 (2 rows, 3 columns)
123456 (the contents of those 6 cells)
32 (3 rows, 2 columns)
654321 (the contents of those 6 cells)

This, of course, assumes that only single-digit numbers of rows and cells can be specified, and only single-digit values stored in them.
Last edited on
@OP You need to break this down into a number of tasks. Write code for one task, then test that it's working, then move on to the next. For example:

- Read from the file the size information for a matrix
- create a matrix with those dimensions
- Read from the file the values to be stored in the matrix
- Store those values in the matrix
- Read the operator from the file
- etc
I started to go there but that does not make sense, you wouldn't inject end of lines in there in that case, as that just makes it more annoying and no one would do that, so I reverted to makes no sense.
Topic archived. No new replies allowed.