运行时错误?

P1968 美元汇率

三实小范世祎 @ 2016-07-25 14:25:45

program l1;
  var
    a:array[1..1005] of real;
    n,i:integer;
    ans:real;
 function max(a,b:real):real;
 begin
   if a>b then exit(a)
   else exit(b);
 end;
begin
  ans:=100;
  readln(n);
  for i:=1 to n do
    begin
      readln(a[i]);
      a[i]:=a[i]/100;
    end;
  for i:=1 to n do
    ans:=max(ans,ans*a[i]/a[i+1]);
  writeln(ans:0:2);
  readln;
  readln;
end.

0分

单步调试时没问题,就是不能正常运行.求教!


by hzqtljh @ 2017-06-01 21:22:39

不能加 program


|