import java.math.BigInteger; import java.util.Scanner; public class Main {//fibs[20] = 6765 ,fibs的上限达到上千位 public static void main(String[] args) { Scanner scanner = new Scanner(System.in); BigInteger[] fibs = new BigInteger[2000]; fibs[1] = new BigInteger("1"); fibs[2] = new BigInteger("1"); int i; for(i = 3 ; i < 2000 ; ++i){ fibs[i] = fibs[i-1].add(fibs[i-2]); } while(scanner.hasNext()){ int n = scanner.nextInt(); System.out.println(fibs[n+1]); } } }