2018-05-23 13:38:41 +00:00
|
|
|
import java.lang.Integer;
|
2023-05-24 14:51:53 +00:00
|
|
|
import java.lang.Double;
|
2023-10-17 10:26:40 +00:00
|
|
|
import java.lang.String;
|
2018-05-23 13:38:41 +00:00
|
|
|
|
2023-10-17 10:26:40 +00:00
|
|
|
public class Fac {
|
|
|
|
getFac(n) {
|
2018-05-23 13:38:41 +00:00
|
|
|
var res = 1;
|
|
|
|
var i = 1;
|
2023-10-17 10:26:40 +00:00
|
|
|
while (i <= n) {
|
2018-05-23 13:38:41 +00:00
|
|
|
res = res * i;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
}
|