How to store these datum 0 from a file inputtxt to an 1d arr

How to store these datum( 0,*) from a file (input.txt) to an 1d array by using FORTRAN language? row=6; column=7

6 7

0000000
00**000
0*00*00
00*0*00
000*000
0000000

Thank you so much!

Solution

PROGRAM readdatum

IMPLICIT NONE

INTEGER, DIMENSION(6,7)::a

INTEGER :: row,col,max_rows,max_cols

max_rows=6

max_cols=7

OPEN(UNIT=11,FILE=\"input.txt\")

DO row=1,max_rows

READ(11,*)(a(row,col),col=1,max_cols)

END DO

END PROGRAM readdatum

How to store these datum( 0,*) from a file (input.txt) to an 1d array by using FORTRAN language? row=6; column=7 6 7 0000000 00**000 0*00*00 00*0*00 000*000 000

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site