PASCAL问题:程序哪里错了?
来源:百度知道 编辑:UC知道 时间:2024/05/08 18:34:18
program UPS(input,output);
uses crt;
type
PointType=record
Last:string;
end;
var
point:array[1..18] of pointType;
PF:text;
I,A:integer;
begin
assign(PF,'Point.txt');
for I:=1 to 18 do
begin
pp[I].last:=10;
readln(point[I].last)
end;
write('Change where?');
readln(A);
point[A].last:=point[A].last+23;
rewrite(pf);
while not eof(pf)do
for I:=1 to 18 do
begin
writeln(pf,point[I].last)
end;
close(pf)
end.
错在哪里?
此程式是为了改变array中某一个的数值,但总是出错.
除之指出错的地方外,请教教本人正确的code ,本人是新手而已~
请问eof是作什麼用的 ?
字符串类型是什麼?
如果能提供教导pascal各种功能和常犯错误的网站更好
uses crt;
type
PointType=record
Last:string;
end;
var
point:array[1..18] of pointType;
PF:text;
I,A:integer;
begin
assign(PF,'Point.txt');
for I:=1 to 18 do
begin
pp[I].last:=10;
readln(point[I].last)
end;
write('Change where?');
readln(A);
point[A].last:=point[A].last+23;
rewrite(pf);
while not eof(pf)do
for I:=1 to 18 do
begin
writeln(pf,point[I].last)
end;
close(pf)
end.
错在哪里?
此程式是为了改变array中某一个的数值,但总是出错.
除之指出错的地方外,请教教本人正确的code ,本人是新手而已~
请问eof是作什麼用的 ?
字符串类型是什麼?
如果能提供教导pascal各种功能和常犯错误的网站更好
15行
pp[I].last:=10;
未定义的表示符:pp
20行
point[A].last:=point[A].last+23;
point[A].last是字符串类型,不是整型
22行
while not eof(pf)do
既然是在pf文件上写东西,pf又怎么会出现文件结束的标志呢?
eof是一个函数,返回值为文件是否结束
字符串类型就是一串字符,比如说
'pascal'就是一个字符串类型
这个程序的目的是什么?