|
|
вернуться в форумWhy doesn't it work? (Pascal) Послано Igor 15 мар 2009 18:26 type TStack=class(TObject) public Data:Extended; Next:TStack; function Add(AData:Extended):TStack; function Delete:TStack; end; function TStack.Add(AData:Extended):TStack; begin Result:=TStack.Create; Result.Data:=AData; Result.Next:=Self end; function TStack.Delete:TStack; begin Result:=Next; Free; end; var Stack:TStack; AData:Extended; begin Stack:=nil; while not eof do begin Read(AData); Stack:=Stack.Add(AData) end; while Stack<>nil do begin Writeln(Sqrt(Stack.Data)); Stack:=Stack.Delete end; end. Re: Why doesn't it work? (Pascal) Послано Megov 15 мар 2009 23:28 while not seekeof do Re: Why doesn't it work? (Pascal) Послано Igor 17 мар 2009 14:34 Edited by author 17.03.2009 14:43 |
|
|