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

Помагите найти ошибку!!!!! Pascal
Posted by Intro 7 Sep 2008 03:15
Всё сделал. у себя на компе проверил ответы сходятся.... а как загружаю ошибка на первом же тесте....

uses
  SysUtils;
var
  ch:char;
  s,s1,s2:string;
  val:array[1..65536]of string;
  i:integer;
  intg:boolean;
  r:double;
begin
  i:=0;
  intg:=false;
  while not eof do
    begin
      read(ch);
      if ((ch<>' ')and(ch<>#10)and(ch<>#13))
        then begin s:=s+ch;intg:=true;end
        else if intg
          then
            begin
              intg:=false;
              inc(i);
              if length(s)>9
                then
                  begin
                   r:=exp((length(s)-9)*ln(10))*strtoint(copy(s,1,9))+strtoint(copy(s,10,length(s)-9));
                   str(sqrt(r):18:4,s);
                   while s[1]=' ' do delete(s,1,1);
                   val[i]:=s;
                  end
                else
                  begin
                    str(sqrt(strtoint(s)):18:4,s);
                   while s[1]=' ' do delete(s,1,1);
                    val[i]:=s;
                  end;
              s:='';
            end;

    end;
  if intg
          then
            begin
              intg:=false;
              inc(i);
              if length(s)>9
                then
                  begin
                   r:=exp((length(s)-9)*ln(10))*strtoint(copy(s,1,9))+strtoint(copy(s,10,length(s)-9));
                   str(sqrt(r):18:4,s);
                   while s[1]=' ' do delete(s,1,1);
                   val[i]:=s;
                  end
                else
                  begin
                    str(sqrt(strtoint(s)):18:4,s);
                   while s[1]=' ' do delete(s,1,1);
                    val[i]:=s;
                  end;
              s:='';
            end;
  for i := i downto 1 do writeln(val[i]);
end.
Re: Помагите найти ошибку!!!!! Pascal
Posted by Danshin Anton (LIOD Orenburg) 14 Sep 2008 14:28
See the "Как определить конец входного потока" topic (10.09/2008)