blob: e1ab1d5d4d110fe2d416d6dc8da32804a4d6a793 [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.
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));
}
}