还需要考虑溢出等问题,闲来无事写了写
Func<float, float, float> a = (arg1, arg2) => 0f;//init var depth = 8; a = (lastNumber, currentNumber) => { if (depth <= 0) return currentNumber; depth--; return a(currentNumber, currentNumber + lastNumber); }; var result = a(0, 1);