재귀함수를 사용한 피보나치 수열
package _2;
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
System.out.print(pina(n));
}
public static int pina(int n) {
if(n==1) return 1;
if(n==1) return 1;
return pina(n-1) + pina(n-2);
}
}