JavaTXCompilerInJavaTX/test/bytecode/javFiles/Faculty.jav

34 lines
467 B
Plaintext
Raw Normal View History

import java.lang.Integer;
public class Faculty {
2017-11-29 13:45:15 +00:00
m (x) {
2017-11-29 13:45:15 +00:00
// 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);
}
2017-11-29 13:45:15 +00:00
}
}