728x90
https://www.acmicpc.net/problem/10870
import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
System.out.println(fibonacci(N));
}
static int fibonacci(int N){
if(N==0) return 0;
if(N==1) return 1;
return fibonacci(N-1) +fibonacci(N-2);
}
}
걍 외워 띠기럴
728x90
'with my rubber duck > codingTest' 카테고리의 다른 글
[백준 7568] 덩치. 뭐가 틀렸다는거임 + 해결 (0) | 2022.07.18 |
---|---|
[백준 2798] 블랙잭 풀어보기 쉽군 ㅎ + 복습 (0) | 2022.07.15 |
[백준 1978]소수찾기. 소수 몇번짼데 아직도 헤매는지 모르겠네 (0) | 2022.07.13 |
[백준 1316] 그룹단어 체크 + 복습 !! (0) | 2022.07.12 |
[프로그래머스] 숫자 문자열과 영단어 풀어보기 (0) | 2022.07.11 |
댓글