python
shell
c
java
class Recursive{ public static void main(String[] args){ System.out.println(recursive(5)); } public static int recursive(int i){ if(i == 1){ return 1; } return i * recursive(i-1); } }
时间: 2024-11-05 04:23:00
python
shell
c
java
class Recursive{ public static void main(String[] args){ System.out.println(recursive(5)); } public static int recursive(int i){ if(i == 1){ return 1; } return i * recursive(i-1); } }