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 Wrong answer(Pascal)
Posted by Sasha 20 Nov 2007 23:44
program BackSQRT;
{$APPTYPE CONSOLE}
uses
  SysUtils;
var
 f,fout: Text;
 a:array[0..99999999] of extended;
 tmp: int64;
 count,j: 0..99999999;
begin
Count:=0;
assignfile(f,'input.txt');
reset(f);
while not Eof(f) do
  begin
  while not Eoln(f) do
      begin
      read(f,tmp);
      if tmp<0 then continue;
      a[count]:=tmp;
      inc(count);  // -1
      end;
  readln(f);
  end;
closefile(f);
assignfile(fout,'out.txt');
rewrite(fout);
for j:=count-1 downto 0 do writeln(fout,sqrt(a[j]):0:4);
closefile(fout);
end.
Re: Why Wrong answer(Pascal)
Posted by Kirill Teplinskiy 21 Nov 2007 00:22
use standart input and output stream...