Java的递归
public class MyArray2 {
public static void main(String[] args)
{
System.out.println(JieCheng(3,5));
}
public static int JieCheng(int i,int a )
{
int sum=1;
for(i=1;i<=a;i++)
{
sum*=i;
}
return sum;
}
}
关键:for循环,初始值的定义