Pagini recente » Cod sursa (job #1260364) | Cod sursa (job #2296237) | Cod sursa (job #559432) | Cod sursa (job #2968323) | Cod sursa (job #2024694)
import java.util.Scanner;
import java.util.Formatter;
import java.io.IOException;
import java.io.File;
import java.math.BigInteger;
public class nunta{
public static void main(String args[]) throws IOException{
Scanner f = new Scanner(new File ("nunta.in"));
Formatter g= new Formatter(new File("nunta.out"));
BigInteger A=new BigInteger("1");
BigInteger B=new BigInteger("1");
BigInteger C=new BigInteger("0");
int n,i;
n=f.nextInt();
for(i=2;i<=n;++i) {
C=A.add(B);
A=B;
B=C;
}
g.format("%d",B);
f.close();g.close();
}
}