Guest User

Untitled

a guest
Oct 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. // Copyright 2015 the Dart project authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license
  3. // that can be found in the LICENSE file.
  4.  
  5. void main() {
  6. var i = 20;
  7. print('fibonacci($i) = ${fibonacci(i)}');
  8. }
  9.  
  10. /// Computes the nth Fibonacci number.
  11. int fibonacci(int n) {
  12. return n < 2 ? n : (fibonacci(n - 1) + fibonacci(n - 2));
  13. }
Add Comment
Please, Sign In to add comment