我正在尝试将整数从文件读取到数组中。但是当我运行程序时出现错误。
PROGRAM MINTEM
INTEGER TEMP(4,7), I, J, MINIMUM, CURRENT
OPEN(UNIT=1, FILE='temps.dat')
READ (1,*) ((TEMP(I,J),J=1,7),I=1,4)
MINIMUM = TEMP(1,1)
DO I = 1,4
DO J = 1,7
IF (TEMP(I,J) < MINIMUM) THEN
MINIMUM = TEMP(I,J)
END IF
END DO
END DO
PRINT *, "MINIMUM TEMPERATURE = ", MINIMUM
END PROGRAM MINTEM
输入文件如下所示:
22
100 90 80 70 60 100 90 80 70 60 100 90 80 70 60 100 90 80 70
100 90