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

What's wrong, the judge throws me wrong answer
Posted by María Fernanda Borge 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.
No subject
Posted by icanwin 18 Oct 2009 13:40


Edited by author 18.10.2009 13:59
Re: What's wrong, the judge throws me wrong answer
Posted by melkiy 18 Oct 2009 20:01
i think you should check for EOF after a read attempt, not before it