SHARE
TWEET

Untitled

a guest Apr 21st, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static int fib(int n) {
  2.     if (n <= 1)
  3.         return n;
  4.     int a = 0;
  5.     int b = 1;
  6.     for (int i = 0; i < n; i++) {
  7.         int c = a;
  8.         a = b;
  9.         b = c + b;
  10.     }
  11.     return a;
  12. }
RAW Paste Data
Top