Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
30
Task/Ackermann-function/Elena/ackermann-function.elena
Normal file
30
Task/Ackermann-function/Elena/ackermann-function.elena
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import extensions;
|
||||
|
||||
ackermann(m,n)
|
||||
{
|
||||
if(n < 0 || m < 0)
|
||||
{
|
||||
InvalidArgumentException.raise()
|
||||
};
|
||||
|
||||
m =>
|
||||
0 { ^n + 1 }
|
||||
: {
|
||||
n =>
|
||||
0 { ^ackermann(m - 1,1) }
|
||||
: { ^ackermann(m - 1,ackermann(m,n-1)) }
|
||||
}
|
||||
}
|
||||
|
||||
public program()
|
||||
{
|
||||
for(int i:=0, i <= 3, i += 1)
|
||||
{
|
||||
for(int j := 0, j <= 5, j += 1)
|
||||
{
|
||||
console.printLine("A(",i,",",j,")=",ackermann(i,j))
|
||||
}
|
||||
};
|
||||
|
||||
console.readChar()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue