ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1001. Reverse Root

Why WA on #3
Posted by cz908640443 8 Mar 2010 13:59
var
  i,j,k,l,m:longint;
  n:qword;
  a:array[1..10000000]of qword;
  q:double;
begin
  n:=0;
  while not eof do begin
    inc(n);
    read(a[n]);
  end;
  for i:=n-1 downto 1do begin
    writeln(sqrt(a[i]):0:4);
  end;
end.
Re: Why WA on #3
Posted by cz908640443 8 Mar 2010 14:04
I finally found where I did wrong...
var
  i,j,k,l,m:longint;
  n:qword;
  a:array[1..10000000]of qword;
  q:double;
begin
  n:=0;
  while not seekeof do begin
    inc(n);
    read(a[n]);
  end;
  for i:=n downto 1do begin
    writeln(sqrt(a[i]):0:4);
  end;
end.

should use "seekeof" instead of "eof"