public static void main(String[] args) {
System.out.println(Func(5));
}
public static int Func(int n)
{
if (n < 0)
{
throw new AbstractMethodError(“不能小于0”);
}
if (n == 0 || n == 1)
{
return 1;
}
System.out.println(n);
return n * Func(n – 1);
}
public static void main(String[] args) {
System.out.println(Func(5));
}
public static int Func(int n)
{
if (n < 0)
{
throw new AbstractMethodError(“不能小于0”);
}
if (n == 0 || n == 1)
{
return 1;
}
System.out.println(n);
return n * Func(n – 1);
}