This commit is contained in:
Ingy döt Net 2013-04-10 16:57:12 -07:00
parent 518da4a923
commit 764da6cbbb
6144 changed files with 83610 additions and 11 deletions

View file

@ -0,0 +1,18 @@
import std.stdio;
int fib(in int n) pure nothrow {
assert(n >= 0);
return (new class {
static int opCall(in int m) pure nothrow {
if (m < 2)
return m;
else
return opCall(m - 1) + opCall(m - 2);
}
})(n);
}
void main() {
writeln(fib(39));
}