看板 Fortran 關於我們 聯絡資訊
想問一個簡單的例子 program test real,dimension(11)::a open(unit=10,file='number.txt',status='old') read(10,*) a write(*,*) a end number.txt裡面有 10個數字 我想把10個數字讀進去a裡面在輸出到螢幕 無奈這邊卻出錯 請問這樣是否可行 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.116.189.152
awer89:open以後要close 04/18 19:24
crazy10167:20 read(10,*,end=30) a 04/19 00:38
crazy10167:write(*,*) a 04/19 00:38
crazy10167:go to 20 04/19 00:38
crazy10167:30 continue 04/19 00:38
crazy10167:end 04/19 00:39
crazy10167:好像錯了 04/19 00:51
Cypresslin:問題不是在於close吧....不close也不是說不行 04/20 14:03
tonyruler:stop? 04/20 22:07
jsb: 關鍵應該是有 11 個空格卻只有 10 個數字。 04/21 12:21
Cypresslin:樓上正解 04/21 16:39