你忘了传递xq和kx了.
修改后的源程序.fp2.0.4编译通过,过了所有测试数据(加了文件接口)
var a:array[1..12] of integer;
bfsd,xq,cc,okx,pd,sq,yf,sc,scq,i,kx,zh,mm:longint;
begin
assign(input,'save.in');reset(input);
assign(output,'save.out');rewrite(output);
for i:=1 to 12 do readln(a);
yf:=0; xq:=0;cc:=0;kx:=0;sq:=0;pd:=0;
for i:=1 to 12 do
begin
inc(xq,300);
kx:=xq-a;
pd:=kx;
if pd<0 then
begin
yf:=i*-1;write(yf);close(input);close(output);halt;
end
else
begin
sq:=(kx div 100)*100;
inc(cc,sq);
dec(kx,sq); pd:=kx;
if pd<0 then begin yf:=i*-1;write(yf);close(input);close(output);halt;end;
xq:=kx;
end;
end;
zh:=0;
if pd>0 then begin
zh:=cc*120 div 100;
zh:=zh+kx;
yf:=zh;end;
writeln(yf);
close(input);close(output);
end.