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

Wrong answer...
Posted by Cross 28 Jan 2011 01:04
What's wrong?


program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  i,n:integer;
  data:string;
  tmp:array of string;

begin
  readln(data);
  n:=0;
  SetLength(tmp,length(data)+1);

  for i:= 1 to length(data) do
    begin
      if not(data[i]=' ')then
        tmp[n]:=tmp[n]+data[i];
      if (data[i]=' ')and (data[i+1]<>' ')then
        n:=n+1;
    end;
  for i:=n downto 1 do
    writeln(sqrt(StrToFloat(tmp[i])):0:4);

  readln;
end.
Re: Wrong answer...
Posted by Tima 7 Apr 2011 12:47
for i:=n downto 0 do
     writeln(sqrt(StrToFloat(tmp[i])):0:4);

Edited by author 07.04.2011 12:47