阅读下列利用递归来求n!的程序:
classFactorialTest{
staticlongFactorial(intn){//定义Factorial()方法
if(n==1)
return1;
else
returnn*Factorial(_____);
}
publicstaticvoidmain(Stringa[]){//main()方法
intn=8;
system.out.println{n+"!="+Factorial(n)};
}
}
为保证程序正确运行,在下划线处应该填入的参数是:
发布于 2022-03-22 01:21:45
【单选题】
A n-1
B n-2
C n
D n+1
E A
F 3
查看更多
- 体验AI问答!更聪明、超智能!
- 一款基于GPT的超级AI助手,可以对话、创作、写文案!