Reading a matrix from a text

I recently ran into this the other day, I'm not that good of a programmer, and the teacher asked us to make a program that reads a square matrix from a txt. and then use the information to solve it. I've been wondering how to do the first part of this program as I already figured it out how to solve the matrix, but I just don't know how to do the scanning of the text. Just so you guys can understand me, this is how the text would look like:

4

1 2 3 8
7 4 1 2
1 2 1 2
3 4 5 6

So as you can see, it has to read the first number and store it in a variable so the program knows the size of the matrix and then read the matrix and store it in an array or so I think.

Any help would be apreciated.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories