Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Stack/M2000-Interpreter/stack-1.m2000
Normal file
15
Task/Stack/M2000-Interpreter/stack-1.m2000
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
Module Checkit {
|
||||
a=Stack
|
||||
Stack a {
|
||||
Push 100, 200, 300
|
||||
}
|
||||
Print StackItem(a, 1)=300
|
||||
Stack a {
|
||||
Print StackItem(1)=300
|
||||
While not empty {
|
||||
Read N
|
||||
Print N
|
||||
}
|
||||
}
|
||||
}
|
||||
Checkit
|
||||
26
Task/Stack/M2000-Interpreter/stack-2.m2000
Normal file
26
Task/Stack/M2000-Interpreter/stack-2.m2000
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
Module Checkit {
|
||||
Read a, b
|
||||
Print a, b
|
||||
}
|
||||
\\ add parameters in a FIFO, and this FIFO merged to current stack
|
||||
Push 100
|
||||
Checkit 10, 20
|
||||
Print StackItem(1)=100
|
||||
Module Checkit {
|
||||
Read a, b
|
||||
Print a=20, b=100
|
||||
}
|
||||
Checkit 20
|
||||
|
||||
Function alfa {
|
||||
k=0
|
||||
n=0
|
||||
while not empty {
|
||||
k+=number
|
||||
n++
|
||||
}
|
||||
if n=0 then Error "No parameters found"
|
||||
=k/n
|
||||
}
|
||||
|
||||
Print alfa(1,2,3,4)=2.5
|
||||
Loading…
Add table
Add a link
Reference in a new issue