public class Sixtheen {
/*利用递归方法求5!。*/
public static void main(String[] args){
System.out.println("5的阶乘是:"+Recursion(5));
}

public static int Recursion (int x){
if(x==1||x==0)
return 1;
else
return x*Recursion(x-1);

}
}

  

 

相关文章:

  • 2022-03-06
  • 2021-08-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-19
  • 2021-08-05
  • 2021-07-18
  • 2021-12-27
  • 2021-04-04
  • 2021-07-31
相关资源
相似解决方案