U E D R , A S I H C RSS

새싹교실/2017/따라와반/과제방 (rev. 1.3)

새싹교실/2017/따라와반/과제방


1. 자바

1.1.1. 이민욱

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // write your code here
        long[] FIBO = new long[100];

        int i;
        for(i=0;i<100;i++){
            FIBO[i]=-1;
        }
        FIBO[0]=0;
        FIBO[1]=1;
        Scanner input = new Scanner(System.in);
        int N = input.nextInt();
        for(i=2;i<=N;i++){
            if(FIBO[i]==-1){
                FIBO[i]=FIBO[i-2]+FIBO[i-1];
            }
        }
        System.out.printf("%d",FIBO[N]);
    }
}

1.1.2. 정석우

(여기에 코드를)
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:30:07
Processing time 0.0163 sec