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 I have the wrong answer? (Pascal)
Posted by BitLord 18 Nov 2007 08:25
Please tell me, why do i have the wrong answer in next code?



program Project2;
var
  fi:text;
  fo:text;
  i,j:integer;
  a:array[1..1000000] of int64;

begin
 i:=0;
 while not EOF do
  begin
  inc(i);
  read(a[i]);
  end;

 for j:=i downto 1 do writeln(sqrt(StrToFloat(IntToStr(a[j]))):0:4);

end.
Re: Why I have the wrong answer? (Pascal)
Posted by KIRILL(ArcSTUpid coder:) 18 Nov 2007 18:25
use seekeof for numbers
StrToFloat(IntToStr(a[j])) is not needed
use extended