public class Test{public static int result(int parameter){if(parameter<=1) return 1;int number = parameter*result(parameter-1); return number;}public static void main(String[]args{int result = result(5);System.out.println(result);}}运行结果是:120
添加回答
举报
0/150
提交
取消