回 帖 发 新 帖 刷新版面

主题:读入数据到数组中

一行中有四个数据,如
1.1   2.2  3.3  4.4

也定义了一个数组real a(4)

怎样将这四个数据读入到这个数组中呢?

open(100,......)
read (100,*) a(i),i=1,4   !在这个地方读取一行中的四个数据到数组。

可是总是通不过。不知道怎样修改?

回复列表 (共2个回复)

沙发

read (100,*) (a(i),i=1,4)   ! Implied-DO Lists in I/O Lists

板凳

[quote]read (100,*) (a(i),i=1,4)   ! Implied-DO Lists in I/O Lists
[/quote]在这个地方读取一行中[url=http://www.shyamodp.com]压模地坪[/url]的四个数据到数组。

我来回复

您尚未登录,请登录后再回复。点此登录或注册