主题:文件读取的错误
read(station,'(A11,A)') time,value1
raindtimed(k, irain) = time
write(raind(k, irain),'(A)') value1
raind(k, irain) = value1
print *,'time :',raindtimed(k, irain)
print *,'rain :',raind(k, irain)
我要通过上面的代码读取下面格式的文本文件
2000/01/01,11.2
2000/01/02,0
2000/01/03,0
2000/01/04,1.6
2000/01/05,0.4
2000/01/06,0
2000/01/07,0
2000/01/08,0
2000/01/09,1.3
但是读出来为什么不对呢,如图片:
我想把raind(k, irain)赋值为rain下一行那个数,但是为什么前面总是加那么多的0呢,求大侠指教啊
raindtimed(k, irain) = time
write(raind(k, irain),'(A)') value1
raind(k, irain) = value1
print *,'time :',raindtimed(k, irain)
print *,'rain :',raind(k, irain)
我要通过上面的代码读取下面格式的文本文件
2000/01/01,11.2
2000/01/02,0
2000/01/03,0
2000/01/04,1.6
2000/01/05,0.4
2000/01/06,0
2000/01/07,0
2000/01/08,0
2000/01/09,1.3
但是读出来为什么不对呢,如图片:
我想把raind(k, irain)赋值为rain下一行那个数,但是为什么前面总是加那么多的0呢,求大侠指教啊