1. 

import java.io.*;
import java.util.*;
import java.math.*;
public class Main {

/**
* @group Lermer Florian, Sayli Hidir, Taskin Umut
* @contact lermer@gmail.de, hidirsayli@hotmail.de taskin_umut@yahoo.de
* @Problem_ID=10579
* @Link http://icpcres.ecs.baylor.edu/onlinejudge/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=17&problem=1520&mosmsg=Submission+received+with+ID+7025025
*
* @status Accepted
* @Version V1.11
*
* @problematical_issues - Primitive Data Types havenīt got enough space for the all Fibonacci numbers!
* So there is a need for BigDecimal Data Type
* - Because of same reason we could not use the Fibonacci-Formula. The Math functions
* like POW or SQRT returns Double Types
* - so they are useless because of not being
* precisely enough. In addition they haven't got enough space so we tried the hard way
* letting the processor calculating the hole way from the beginning till the end.
*
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException
{
//Using ArrayList will allow us being dynamical
ArrayList<Integer> list=new ArrayList<Integer>();
//Scanner will get the inputs entered from the keyboard
Scanner sc=new Scanner(System.in);
//Scanning and Adding every Integer which was entered from the keyboard
do
{
list.add(sc.nextInt());
}while(sc.hasNext());

//Calculating Fibonacci Sequence Point for every Integer in the ArrayList
for (Integer integer : list)
{
//have to use BigDecimal for precision and space
BigDecimal f0=new BigDecimal(0);
BigDecimal f1=new BigDecimal(1);
for(int x=2;x<=integer;x++)
{
BigDecimal tmp=new BigDecimal(0);
tmp=tmp.add(f0.add(f1));
f0=f1;
f1=tmp;
}
System.out.println(f1);
/*
*tried to use the fibonaci formula! Failed cause Math.Pow and Math.SQRT at first arenīt precisely enough and at second havenīt enough space for the hole number
BigDecimal bd1=new BigDecimal((1/Math.sqrt(5)));//System.out.println((long)((1/Math.sqrt(5))*(Math.pow(((1+Math.sqrt(5))/2), integer)-Math.pow(((1-Math.sqrt(5))/2), integer))));
BigDecimal bd2=new BigDecimal(Math.pow(((1+Math.sqrt(5))/2), integer));
BigDecimal bd3=new BigDecimal(Math.pow(((1-Math.sqrt(5))/2), integer));
BigDecimal bd=new BigDecimal(0);
bd=bd1.multiply(bd2) ;
bd2=bd1.multiply(bd3);
bd=bd.subtract(bd2);
System.out.println(bd.toString());
*/
}
}
}

2.

/*
@author Markus Mohr, Rolf Schirm, Franz Mathauser
Version: 1.1
Date: 25.03.2009

7026749 10579 Fibonacci Numbers Accepted JAVA 0.130 2009-03-25 14:25:28

IFB 2C
*/

//10579

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class Main {
   
   
    private static BigInteger fib(int iThFib) {
        // 0 1 2 3 4 5 6  7  8  9
        // 0 1 1 2 3 5 8 13 21 34
 
        if (iThFib < 0)
            throw new IllegalArgumentException(
                    "Negative values are not allowed! Given: " + iThFib);
 
        if (iThFib < 2) {
            return BigInteger.valueOf(iThFib);
        }
 
        BigInteger current = BigInteger.valueOf(1);
        BigInteger previous = BigInteger.valueOf(0);
        BigInteger result = null;
        for (int i = 2; i <= iThFib; i++) {
            result = current.add(previous);
            previous = current;
            current = result;
        }
        return result;
    }
   
    public static void main(String... args)    throws IOException{
      
        int buf = 0;
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        while(true)    {         
              String line = reader.readLine();
             
              if( line == null)
                  break;
             
              buf = Integer.parseInt(line);
           
             
             
              System.out.println(fib(buf));
            }
        }

}

3.

/**
* Angewandte Mathematik, SS09, IFB 2C
* ACM Problem #10579 (FibonacciNumbers)
* Link: http://icpcres.ecs.baylor.edu/onlinejudge/index.php?option=com_onlinejudge&Itemid=8&category=17&page=show_problem&problem=1520
*
* @author Christian Posselt
* @author Jonathan Schubert
* @version 1.2, 03/30/2009
*
* Status : Accepted
* Runtime: 0.150
*/

import java.math.*;
import java.util.Scanner;
class FibonacciNumbers10579
{
public static void main(String[] args)
{
Scanner Scanner = new Scanner(System.in);
int index,n;
BigDecimal result,lastResult,lastLastResult;
while(Scanner.hasNext()) //Read all the lines
{
result = new BigDecimal(0);
lastResult = new BigDecimal(0);
lastLastResult = new BigDecimal(1);
n = Scanner.nextInt();

for(index = 1; index <= n; index ++)
{
result = lastResult.add(lastLastResult); //f(n)
lastLastResult = lastResult; //f(n-1)
lastResult = result; //f(n-2)
}
System.out.println(result.toString());
}
}
}

4.

/**
* Angewandte Mathematik, SS09, IFB 2C
* ACM Problem: Fibonacci Numbers (10579)
* @author Christian Mitterreiter
* @author Rolf Luigs
* @version 1.0, 03/23/2009
* Status : Accepted
* Runtime: 0.150
*/


import java.util.Scanner;
import java.math.BigDecimal;



public class Main {

public static void main(String[] args) throws Exception {

Scanner scanner = new Scanner(System.in);

int[] input = new int[100000];



for(int i = 0; scanner.hasNext();i++) {

input[i]=scanner.nextInt();
if(input[i]!=0) {

BigDecimal tmp1 = new BigDecimal(1); //Die letzten beiden Zahlen werden immer zu einer neuen Zahl zusammenaddiert.
BigDecimal tmp2 = new BigDecimal(0);
BigDecimal tmp3 = new BigDecimal(0);

for(int x=0;x<input[i]-1;x++)
{
tmp3 = tmp1.add(tmp2);
tmp2 = tmp1;
tmp1 = tmp3;
}
System.out.println(tmp1.toString());
}

else System.out.println("0");

}

}
}

4.

import java.io.*;
import java.util.Scanner;
import java.math.BigInteger;

/**
* Angewandte Mathematik, SS09, IFB 2C
* ACM Problem #10579 (Euclid Problem)
* Link: http://icpcres.ecs.baylor.edu/onlinejudge/index.php?option=com_onlinejudge&Itemid=8&category=13&page=show_problem&problem=1045
*
* @author Fabian Seidl
* @author Marcel Sachse
* @version 1.0, 30/03/2009
*
* Status : Accpted
* Runtime: 0.150
*/

public class Main {

public static void main(String[] args) throws Exception
{
BufferedInputStream bInput = new BufferedInputStream(System.in);
Scanner scanner = new Scanner(bInput);

Writer out = new BufferedWriter(new PrintWriter(System.out));

while(scanner.hasNextInt())
{
int a = scanner.nextInt();
out.write(fib(a) + "\n");

}
out.flush();
out.close();
}

private static BigInteger[] cache = new BigInteger[5000];

private static BigInteger fib(int n)
{
if(n==1) return BigInteger.valueOf(1);
if(n==2) return BigInteger.valueOf(1);

// cache prūfen
BigInteger cacheVal = cache[n];
if(cacheVal!=null)
return cacheVal;

// nicht im cache
BigInteger result = fib(n-1).add(fib(n-2));
cache[n] = result;
return result;

}

}