1113: 递归调用的次数统计(函数专题)
import java.util.Scanner;
public class Main {
static int c=0;public static int fib(int n){
c++;if(n==1||n==2) return 1;else return fib(n-1)+fib(n-2);}public static void main(String[] args) {
Scanner cin = new Scanner(System.in);int n=cin.nextInt();System.out.println(fib(n));System.out.println("递归调用了"+c+"次");}
}