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 do I always have wrong answer?(Pascal)
Posted by dezaixing 30 Mar 2008 08:44
program p1001;
  var
    a:array[1..1000000] of extended;
    l,k,t:integer;
    i:longint;
  begin
    i:=1;
    repeat
      k:=0;
      while not seekeoln do
        begin
          read(a[i]);
          i:=i+1;
          k:=k+1;
        end;
      readln;
      if k=0 then t:=t+1 else t:=0;
    until(t=2);
    for l:=i-1 downto 1 do
      writeln(sqrt(a[l]):0:4);
  end.