|
|
вернуться в форумCrash (access violation) PASCAL Послано ypjie 24 авг 2009 11:35 var i, n : longint; s : string; ans : array[1 .. 500000] of real; procedure work(s : string); var flag, temp : longint; num : qword; begin while s <> '' do begin while s[1] = ' ' do delete(s, 1, 1); flag := pos(' ', s); if flag = 0 then flag := length(s) + 1; val(copy(s, 1, flag - 1), num, temp); delete(s, 1, flag); n := n + 1; ans[n] := sqrt(num); end; end; begin while not eof do begin readln(s); work(s); end; for i :=n downto 1 do writeln(ans[i] : 0 : 4); end. Re: Crash (access violation) PASCAL I'm sorry, but i dont think yor algorithm is correct.. And .. I crash as well . I dont know why.. Edited by author 08.10.2009 16:49 |
|
|