2018-05-30 00:27:20 +02:00
|
|
|
import java.lang.Integer;
|
|
|
|
|
2017-11-29 14:45:15 +01:00
|
|
|
class Faculty {
|
|
|
|
|
|
|
|
m () {
|
|
|
|
|
|
|
|
var fact = (Integer x) -> {
|
2018-06-15 16:19:12 +02:00
|
|
|
if (x == 1) {
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return x * fact.apply(x-1);
|
|
|
|
}
|
2017-11-29 14:45:15 +01:00
|
|
|
};
|
|
|
|
return fact;
|
|
|
|
}
|
|
|
|
}
|