mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:07:49 +00:00
15 lines
327 B
Plaintext
15 lines
327 B
Plaintext
library;
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
static method fibonacci(core::int n) → core::int {
|
|
if(n.<(2))
|
|
return n;
|
|
return self::fibonacci(n.-(1)).+(self::fibonacci(n.-(2)));
|
|
}
|
|
static method main() → dynamic {
|
|
for (core::int i = 0; i.<(20); i = i.+(1)) {
|
|
core::print(self::fibonacci(i));
|
|
}
|
|
}
|