JavaCompilerCore/resources/bytecode/javFiles/Faculty.jav

53 lines
887 B
Plaintext
Raw Normal View History

import java.lang.Integer;
//import java.lang.Long;
//import java.lang.Short;
public class Faculty {
public fact;
Faculty() {
fact = (x) -> {
if (x == 1) {
return 1;
}
else {
return x * (fact.apply(x-1));
}
};
}
2019-08-23 13:06:54 +00:00
2023-05-24 11:53:23 +00:00
public getFact(java.lang.Integer x) {
return fact.apply(x);
}
}
// m (x) {
//
//// var fact = (x) -> {
//// if (x == 1) {
//// return x;
//// }
//// else {
//// return x * (fact.apply(x-1));
//// }
//// };
//// return fact;
//// var x = 13;
//// if(x>22) {
//// return 0;
//// }else if(x <1){
//// return x;
//// }else {
//// return 1;
//// }
//
// if (x < 0) {
// return 0;
// }else if(x<2) {
// return x;
// } else {
// return x * m(x-1);
// }
// }
//}