mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-12 15:59:22 +01:00
10 lines
211 B
PowerShell
10 lines
211 B
PowerShell
|
function fibonacci($n) {
|
||
|
if ($n -lt 2) { return 1 }
|
||
|
return (fibonacci($n - 1)) + (fibonacci($n - 2))
|
||
|
}
|
||
|
|
||
|
|
||
|
foreach ($i in 0..100) {
|
||
|
Write-Host "$(fibonacci $i), " -noNewline
|
||
|
}
|
||
|
exit 0 # success
|