diff --git a/bigInteger/Code_10826.java b/bigInteger/Code_10826.java index 3e57c53..f770867 100644 --- a/bigInteger/Code_10826.java +++ b/bigInteger/Code_10826.java @@ -1,9 +1,7 @@ package bigInteger; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; import java.math.BigInteger; +import java.util.Scanner; /* * ÀÛ¼ºÀÏ : 2018³â 07¿ù 15ÀÏ @@ -13,6 +11,20 @@ */ public class Code_10826 { + public static void main(String[] args) { + + Scanner sc = new Scanner(System.in); + int num = sc.nextInt(); + BigInteger[] d = new BigInteger[Math.max(num+1, 2)]; + d[0]=BigInteger.ZERO; + d[1]=BigInteger.ONE; + for(int i=2; i<=num; ++i) { + d[i] = d[i-1].add(d[i-2]); + } + System.out.println(d[num]); + } + + /** Àç±Í·ÎÇß´Ù°¡ ·±Å¸ÀÓ ¿¡·¯ °è¼Ó ¹ß»ý.. static BigInteger[] arr = new BigInteger[10000]; public static void main(String[] args) throws NumberFormatException, IOException { @@ -41,5 +53,5 @@ static BigInteger pibonacci(int num) { } } } - + **/ }