|
|
back to boardteach newfag, plz uses SysUtils; procedure RSqrt(k: Integer); var n: real; output: real; begin k:=k+1; Read(n); if n = -1 then exit; output:=Sqrt(n); if k > 0 then RSqrt(k-1); Writeln(output:0:4); end; begin while not SeekEof do RSqrt(0); end. //------------------------------------------ Well, can anybody tell me why it doesn't work? Perhaps, because of this
if n = -1 then exit; Please, don't tell me smth like "go on reading FAQ" or "use your 'while not seekeof do'." Can you just explain my mistake in this code? You know, technically, my program is working right! Re: teach newfag, plz And yes, I got "crashed (stack overflow)" Edited by author 05.11.2011 20:20 |
|
|