From 83f659d36b8c64209b72e70583cb4f0a6852e7be Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 10 Feb 2021 22:18:52 +0400 Subject: =?UTF-8?q?=D0=97=D0=B0=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB=20run.sh=20?= =?UTF-8?q?=D0=BD=D0=B0=20Makefile=20=D0=B8=20=D0=B2=D1=8B=D0=BD=D0=B5?= =?UTF-8?q?=D1=81=20=D1=80=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D1=8E=20=D1=81=D1=82=D0=B5=D0=BA=D0=B0=20=D1=81=20=D1=84=D1=83?= =?UTF-8?q?=D0=BD=D0=BA=D1=86=D0=B8=D1=8F=D0=BC=D0=B8=20=D0=B2=20=D0=BE?= =?UTF-8?q?=D1=82=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20=D1=84=D0=B0?= =?UTF-8?q?=D0=B9=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- structures/task5.cpp | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) (limited to 'structures/task5.cpp') diff --git a/structures/task5.cpp b/structures/task5.cpp index 72e1381..f182625 100644 --- a/structures/task5.cpp +++ b/structures/task5.cpp @@ -1,36 +1,7 @@ #include -using namespace std; - -struct stack -{ - int inf; - stack *next; -}; +#include "stack.h" -void push(stack *&h, int x) -{ - stack *r = new stack; - r->inf = x; - r->next = h; - h = r; -} - -int pop(stack *&h) -{ - int i = h->inf; - stack *r = h; - h = h->next; - delete r; - return i; -} - -void reverse(stack *&h) -{ - stack *head1 = NULL; - while (h) - push(head1, pop(h)); - h = head1; -} +using namespace std; stack *result(stack *&h) { -- cgit v1.2.3