面试的时候经常会有手写递归和手写斐波那契递归两种.
递归代码
public class DiGui {
//设置初始sum为0
private int sum = 0;
//设置初始num为1
private int num = 1;
public int Sum(int maxNum){
if ((num <= maxNum)){
sum
面试的时候经常会有手写递归和手写斐波那契递归两种.
递归代码
public class DiGui {
//设置初始sum为0
private int sum = 0;
//设置初始num为1
private int num = 1;
public int Sum(int maxNum){
if ((num <= maxNum)){
sum