Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Ackermann-function/Rust/ackermann-function-1.rust
Normal file
14
Task/Ackermann-function/Rust/ackermann-function-1.rust
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
fn ack(m: isize, n: isize) -> isize {
|
||||
if m == 0 {
|
||||
n + 1
|
||||
} else if n == 0 {
|
||||
ack(m - 1, 1)
|
||||
} else {
|
||||
ack(m - 1, ack(m, n - 1))
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let a = ack(3, 4);
|
||||
println!("{}", a); // 125
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue