7 lines
252 B
Text
7 lines
252 B
Text
println("Derangements of 0,1,2,3:\n",derangements(4));
|
|
println("\nTable of n vs counted vs calculated derangements:");
|
|
foreach n in (10){
|
|
println("%2d %-6d %-6d".fmt(n, derangers(n), subFact(n)));
|
|
}
|
|
|
|
n:=20; println("\n!%d = %d".fmt(n, subFact(n)));
|