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

María Fernanda Borge What's wrong, the judge throws me wrong answer [2] // Problem 1001. Reverse Root 18 Oct 2009 01:30
program reverseroot;


const
   max=10000000;

type
  tipovec=array[1..max] of double;

var
  i:int64;
  n:double;
  vec:tipovec;
  j:longint;
begin
i:=1;
   while not(eof) do
   begin
      read(n);
      vec[i]:=sqrt(n);
      inc(i);
   end;
   for j:=i-1 downto 1 do
   begin
      writeln(vec[j]:0:4);
   end;
end.
icanwin No subject // Problem 1001. Reverse Root 18 Oct 2009 13:40


Edited by author 18.10.2009 13:59
i think you should check for EOF after a read attempt, not before it