mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
11 lines
140 B
V
11 lines
140 B
V
fn factorial(n u32) u32 {
|
|
if dump(n <= 1) {
|
|
return dump(1)
|
|
}
|
|
return dump(n * factorial(n - 1))
|
|
}
|
|
|
|
fn main() {
|
|
println(factorial(5))
|
|
}
|