public class fibonacci{
public static void main(String[] args) {
Scanner myScan = new Scanner(System.in);
int number = myScan.nextInt();
int res = solve(number);
System.out.println(res);
}
public static int solve(int n) {
if(n == 1 || n == 2) {
return 1;
} else {
return solve(n - 1) + solve(n - 2);
}
}
}
10-12
2318
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)