Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. /**
  2.  * Created by Betim on 4/27/2015.
  3.  */
  4. public class Iter {
  5.     public static void iter(long[] n){
  6.         for(int i=0;i<n.length;i++){
  7.             if(i==0||i==1){
  8.                 n[i]=1;
  9.             }
  10.             else{
  11.                 n[i]=n[i-1]+n[i-2]+1;
  12.             }
  13.             System.out.println(n[i]);
  14.         }
  15.  
  16.     }
  17.     public static void main(String[] args){
  18.         long[] x=new long[31];
  19.         iter(x);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement