RosettaCodeData/Task/Multifactorial/Objeck/multifactorial.objeck
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

21 lines
505 B
Text

class Multifact {
function : MultiFact(n : Int, deg : Int) ~ Int {
result := n;
while (n >= deg + 1){
result *= (n - deg);
n -= deg;
};
return result;
}
function : Main(args : String[]) ~ Nil {
for (i := 1; i <= 5; i+=1;){
IO.Console->Print("Degree ")->Print(i)->Print(": ");
for (j := 1; j <= 10; j+=1;){
IO.Console->Print(' ')->Print(MultiFact(j, i));
};
IO.Console->PrintLine();
};
}
}