blob: 48f6d852fcff7005fb2bf43b5b03136c41d29d59 [file] [log] [blame]
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// @dart=2.6
int fibonacci(int n) {
if (n < 2) return n;
return fibonacci(n - 1) + fibonacci(n - 2);
}
main() {
for (int i = 0; i < 20; i++) {
print(fibonacci(i));
}
}