mirror of
https://github.com/edg-l/edlang.git
synced 2024-09-07 19:35:16 +00:00
15 lines
254 B
Rust
15 lines
254 B
Rust
mod Main {
|
|
pub fn main() -> i32 {
|
|
let b: i32 = factorial(4);
|
|
return b;
|
|
}
|
|
|
|
pub fn factorial(n: i32) -> i32 {
|
|
if n == 1 {
|
|
return n;
|
|
} else {
|
|
return n * factorial(n - 1);
|
|
}
|
|
}
|
|
}
|