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