Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Stack/Ring/stack.ring
Normal file
17
Task/Stack/Ring/stack.ring
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# Project : Stack
|
||||
|
||||
load "stdlib.ring"
|
||||
ostack = new stack
|
||||
for n = 5 to 7
|
||||
see "Push: " + n + nl
|
||||
ostack.push(n)
|
||||
next
|
||||
see "Pop:" + ostack.pop() + nl
|
||||
see "Push: " + "8" + nl
|
||||
ostack.push(8)
|
||||
while len(ostack) > 0
|
||||
see "Pop:" + ostack.pop() + nl
|
||||
end
|
||||
if len(ostack) = 0
|
||||
see "Pop: stack is empty" + nl
|
||||
ok
|
||||
Loading…
Add table
Add a link
Reference in a new issue