X
xieha
Unregistered / Unconfirmed
GUEST, unregistred user!
文本文件中是一行的纪录:如下:
9.95178
4.88231
8.19456
6.45443
4.79758
7.57071
9.72289
1.41951
3.71803
6.43871
可是用下面的程序,却只能这样显示:
9.95178 4.88231
8.19456 6.45443
4.79758 7.57071
9.72289 1.41951
3.71803 6.43871
程序如下:
var s:string[150];
i,j:real;
MyFile:TextFile;
begin
AssignFile(Myfile,'f:/exam/t2.txt');
reset(Myfile);
try
while not Eof(Myfile) do
begin
Readln(Myfile,s,j);
Memo1.Lines.Add(s+' '+floattostr(j));
end;
finally
closeFile(MyFile);
end;
9.95178
4.88231
8.19456
6.45443
4.79758
7.57071
9.72289
1.41951
3.71803
6.43871
可是用下面的程序,却只能这样显示:
9.95178 4.88231
8.19456 6.45443
4.79758 7.57071
9.72289 1.41951
3.71803 6.43871
程序如下:
var s:string[150];
i,j:real;
MyFile:TextFile;
begin
AssignFile(Myfile,'f:/exam/t2.txt');
reset(Myfile);
try
while not Eof(Myfile) do
begin
Readln(Myfile,s,j);
Memo1.Lines.Add(s+' '+floattostr(j));
end;
finally
closeFile(MyFile);
end;