|
|
вернуться в форумwhy crash at test1? Послано l 27 окт 2007 22:25 program ural1001(input,output); var s:string; i,len:longint; n:int64; use:boolean; ans:array[1..500000] of real; begin
while not seekeof do begin readln(s); i:=1; repeat while s[i]=' ' do inc(i); n:=0;use:=false; while (s[i]>='0') and (s[i]<='9') and (i<=length(s)) do begin n:=n*10+ord(s[i])-48; inc(i); use:=true; end; if use then begin inc(len);ans[len]:=sqrt(n);end; until i>=length(s); end; for i:=len downto 1 do writeln(ans[i]:0:4); end. Re: why crash at test1? Use data types lika int64, double, extended to get such big numbers. You should also use seekeoln. |
|
|