Hallo, ich kenne mich leider nicht in diesem Forum aus, und weiß nicht ob man das hier so fragen kann. Aber ich würde gerne für ein Projekt in der Schule die Ausgabe von folgendem Programm als Textdatei speichern.
Java:
// Java program to compute n-th Fibonacci
import java.io.*;
import java.util.*;
import java.math.*;
import java.io.FileWriter;
public class Fibonacci
{
// Returns n-th Fibonacci number
static BigInteger fib(int n)
{
BigInteger a = BigInteger.valueOf(0);
BigInteger b = BigInteger.valueOf(1);
BigInteger c = BigInteger.valueOf(1);
for (int j=2 ; j<=n ; j++)
{
c = a.add(b);
a = b;
b = c;
}
return (b);
}
public static void main(String[] args)
{
int n = 1000;
System.out.println("Fibonacci of " + n +
"th term" + " " +"is" +" " + fib(n));
}
}