Created
          January 20, 2014 23:58 
        
      - 
      
- 
        Save pepet96/8531817 to your computer and use it in GitHub Desktop. 
    Fibonacci Sequence, cannot go further than 92
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import java.util.Scanner; | |
| import java.io.*; | |
| public class Fibonacci { | |
| public static void main (String [] args) { | |
| long f = 0; | |
| long n = 1; | |
| Scanner input = new Scanner(System.in); | |
| int x = input.nextInt(); | |
| for(int i=1; i<=x; i++) { | |
| f = f + n; | |
| n = f - n; | |
| } | |
| n = n; | |
| f = f; | |
| System.out.println(f); | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment