G
GeekBoy
I am reading a file of numbers using for loops.
The numbers are in a grid as follows:
8 36 14 11 31 17 22 23 17 8 9 33
23 32 18 39 23 25 9 38 14 38 4 22
18 11 31 19 16 17 9 32 25 8 1 23
19 13 33 28 5 28 34 19 34 32 0 7
25 0 16 5 12 4 15 39 33 33 29 21
6 0 34 1 16 14 15 2 29 0 16 20
16 29 24 6 37 24 38 4 21 6 7 13
20 29 11 32 18 6 4 3 31 20 21 4
19 5 8 3 20 17 35 15 25 24 11 8
7 9 1 22 26 33 12 0 30 0 32 31
There are 2 for loops. The first one takes a user input and reads each
line up to a point of the user input: (eg User: 4; grabs the first 4
numbers of each row)
The problem is reading the next line. Instead the for statement going
to next line it contines on from where it left off (eg 4-again; 8 36
14 11; 31 17 22 23
I have the numbers as ints and not using , nor cannot use arrays.
Any advice how to get to the next line? I did try reading in the
whole line then printout the desired number length.
Thanks a lot.
GB
The numbers are in a grid as follows:
8 36 14 11 31 17 22 23 17 8 9 33
23 32 18 39 23 25 9 38 14 38 4 22
18 11 31 19 16 17 9 32 25 8 1 23
19 13 33 28 5 28 34 19 34 32 0 7
25 0 16 5 12 4 15 39 33 33 29 21
6 0 34 1 16 14 15 2 29 0 16 20
16 29 24 6 37 24 38 4 21 6 7 13
20 29 11 32 18 6 4 3 31 20 21 4
19 5 8 3 20 17 35 15 25 24 11 8
7 9 1 22 26 33 12 0 30 0 32 31
There are 2 for loops. The first one takes a user input and reads each
line up to a point of the user input: (eg User: 4; grabs the first 4
numbers of each row)
The problem is reading the next line. Instead the for statement going
to next line it contines on from where it left off (eg 4-again; 8 36
14 11; 31 17 22 23
I have the numbers as ints and not using , nor cannot use arrays.
Any advice how to get to the next line? I did try reading in the
whole line then printout the desired number length.
Thanks a lot.
GB