i started programming short time ago, and i cant understand what´s going wrong with the program i made, i expect someone can help me.
the matrix.txt i refer in the program is:
21 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
14 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
75 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
85 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
96 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
03 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
54 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
55 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
34 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
56 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
77 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
22 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
33 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
44 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
10 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
12 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
13 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
17 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
34 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
56 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
and the program is:
PROGRAM MATRIX
INTEGER J,A,L
DIMENSION A(20,20)
L=0
OPEN(20,FILE='matriz.txt',STATUS='OLD')
DO WHILE (L.LT.20)
L=L+1
read(20,'(20(I2))')
ENDDO
L=0
DO WHILE (L.LT.20)
L=L+1
WRITE(*,'(20(1X,I2))') (A(L,J),J=1,20)
ENDDO
END
But the result of it is a totally different matrix, and a can´t get why..=/
someone pleasee.
the matrix.txt i refer in the program is:
21 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
14 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
75 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
85 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
96 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
03 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
54 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
55 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
34 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
56 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
77 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
22 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
33 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
44 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
10 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
12 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
13 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
17 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
34 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
56 13 34 44 55 33 78 90 32 11 21 32 43 55 66 97 23 21 78 56
and the program is:
PROGRAM MATRIX
INTEGER J,A,L
DIMENSION A(20,20)
L=0
OPEN(20,FILE='matriz.txt',STATUS='OLD')
DO WHILE (L.LT.20)
L=L+1
read(20,'(20(I2))')
ENDDO
L=0
DO WHILE (L.LT.20)
L=L+1
WRITE(*,'(20(1X,I2))') (A(L,J),J=1,20)
ENDDO
END
But the result of it is a totally different matrix, and a can´t get why..=/
someone pleasee.