mirror of
https://github.com/edg-l/edlang.git
synced 2024-11-23 00:18:24 +00:00
14 lines
194 B
Rust
14 lines
194 B
Rust
|
|
pub fn main() -> i32 {
|
|
let b: i32 = factorial(4);
|
|
return b;
|
|
}
|
|
|
|
fn factorial(n: i32) -> i32 {
|
|
if n == 1 {
|
|
return n;
|
|
} else {
|
|
return n * factorial(n - 1);
|
|
}
|
|
}
|