纯Lambda实现斐波那契数列

还需要考虑溢出等问题,闲来无事写了写

Func<float, float, float> a = (arg1, arg2) => 0f;//init

var depth = ;
a = (lastNumber, currentNumber) =>
{
if (depth <= ) return currentNumber;
depth--;
return a(currentNumber, currentNumber + lastNumber);
}; var result = a(, );
上一篇:MacOS下制作linux启动盘


下一篇:新世界主机_XenServer7.0都有哪些优势?